• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:15
CEST 16:15
KST 23:15
  • 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] Ro8 Preview Pt2: Progenitors4Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists22
Community News
RSL Revival: Season 5 - Qualifiers and Main Event10Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced92026 GSL Tour plans announced15
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Team Liquid Map Contest #22 - The Finalists MaNa leaves Team Liquid
Tourneys
2026 GSL Season 2 Qualifiers Sparkling Tuna Cup - Weekly Open Tournament StarCraft Evolution League (SC Evo Biweekly) $1,400 SEL Season 3 Ladder Invitational RSL Revival: Season 5 - Qualifiers and Main Event
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Why there arent any 256x256 pro maps? BW General Discussion ASL21 General Discussion [ASL21] Ro8 Preview Pt2: Progenitors BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[ASL21] Ro8 Day 3 [ASL21] Ro8 Day 2 [Megathread] Daily Proleagues Escore Tournament StarCraft Season 2
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread OutLive 25 (RTS Game) Daigo vs Menard Best of 10 Dawn of War IV Nintendo Switch Thread
Dota 2
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
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 European Politico-economics QA Mega-thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Movie Stars In Video Games: …
TrAiDoS
ramps on octagon
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1048 users

The Big Programming Thread - Page 1015

Forum Index > General Forum
Post a Reply
Prev 1 1013 1014 1015 1016 1017 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.
Burned Toast *
Profile Blog Joined May 2007
Canada2040 Posts
January 07 2020 01:56 GMT
#20281
Is there an API or something that can locate a specific frame in a Youtube video by image recognition ?

I would love to develop a more automated process when i write the posts for the for Small Vod Thread, and the ability to locate the frames with the image of the BW lobby in a long youtube video would be an interesting time saver...
TvT matchup is sometimes worse than jailtime
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
January 07 2020 02:48 GMT
#20282
Could you not download the video then run some sort of recognition software on that?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Silvanel
Profile Blog Joined March 2003
Poland4751 Posts
January 07 2020 08:13 GMT
#20283
I think its more a problem with recognition itself? If not You can always automate the browser with something like selenium and simply run recognition on what is displayed to the user. Unless of course You want to run it headless and/on multiple videos at the same time. Then its becomes a little more complicated but still doable with something like selenium grid.
Pathetic Greta hater.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2020-01-07 13:56:33
January 07 2020 13:56 GMT
#20284
--- Nuked ---
Acrofales
Profile Joined August 2010
Spain18285 Posts
Last Edited: 2020-01-07 18:42:29
January 07 2020 18:41 GMT
#20285
Agree with nesserev. Doing any kind of serious processing through selenium sounds like a huge pain in the ass. However awesome selenium is, it isn't really designed for this type of task. I also don't think the youtube data api allows you to download a video, but there are tons of ways of doing that (and automating this process if you have a URL, which you *can* search for with the data API).
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
January 07 2020 22:15 GMT
#20286
On January 07 2020 22:56 Nesserev wrote:
Show nested quote +
On January 07 2020 17:13 Silvanel wrote:
I think its more a problem with recognition itself? If not You can always automate the browser with something like selenium and simply run recognition on what is displayed to the user. Unless of course You want to run it headless and/on multiple videos at the same time. Then its becomes a little more complicated but still doable with something like selenium grid.

Doing everything with selenium sounds like a massive pain and limiting your options; just use Google's Youtube Data API to check for new videos, download the videos, and then process the videos locally.

  1. uses database to keep track of relevant channels and their videos
  2. periodically scan channel for new videos
  3. download videos
  4. use visual/audio recognition library to determine timestamps


Btw, wouldn't it be better to search for the countdown signal? It's very distinct, and should be easy to recognize.


Nice idea!

In either the audio or visual route you can use ffmpeg (www.ffmpeg.org). The doot doot doot swwsssh audio is probably faster rather than extracting all the frames then searching through one-by-one.
TRUEESPORTS || your days as a respected member of team liquid are over
Djzapz
Profile Blog Joined August 2009
Canada10681 Posts
Last Edited: 2020-01-08 01:32:43
January 08 2020 01:29 GMT
#20287
Probably not the point of this thread but I'll just write what I've been up to.

I just started dabbling in Python 3 days ago. It's my first experience "coding" it and I've been struggling so hard. I wrote a game where you start with $100 and then you gamble with it until you're at $0. I also made a thing that calculates factorials and displays n numbers of the fibonacci sequence. My code is absolute patchwork though.

I'd like to be able to write scripts to parse through websites someday but damn, this is hard...
"My incompetence with power tools had been increasing exponentially over the course of 20 years spent inhaling experimental oven cleaners"
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
January 08 2020 04:49 GMT
#20288
Parsing websites is fucking awful. Ignoring the part where bad devs make everything 43 nested tables and good devs make things properly but every time a site is deployed every id and class name changes, it's fucking hard.

Parsing most sites isn't even usually worth it, as there are typically APIs to get the raw and specific data you want from the source, and if not, someone else has already written a scraper and made an API that'll give you that anyway.

Unless you want to get into something like adblock tech or the like, scraping is a path to the dark side of HTML.
Liquipediaasante sana squash banana
Djzapz
Profile Blog Joined August 2009
Canada10681 Posts
January 08 2020 05:01 GMT
#20289
On January 08 2020 13:49 tofucake wrote:
Parsing websites is fucking awful. Ignoring the part where bad devs make everything 43 nested tables and good devs make things properly but every time a site is deployed every id and class name changes, it's fucking hard.

Parsing most sites isn't even usually worth it, as there are typically APIs to get the raw and specific data you want from the source, and if not, someone else has already written a scraper and made an API that'll give you that anyway.

Unless you want to get into something like adblock tech or the like, scraping is a path to the dark side of HTML.

Damn . Well it's fun anyway!
"My incompetence with power tools had been increasing exponentially over the course of 20 years spent inhaling experimental oven cleaners"
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2020-01-08 19:51:22
January 08 2020 17:33 GMT
#20290
Some websites can be pretty atrocious, but in general my experience with scraping websites is that it isn't *too* awful. A bit menial but how horrible it is will generally correspond mostly to how varied the information you are trying to get is.

Djzapz if you need any python help I'd love to help you with questions. You can pm me here or some quicker alternative too if you need.
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
January 08 2020 19:11 GMT
#20291
Yeah python is the easy part, I can help with that too.
Liquipediaasante sana squash banana
Djzapz
Profile Blog Joined August 2009
Canada10681 Posts
January 08 2020 21:09 GMT
#20292
Thanks guys, I appreciate the offer! I'm good for now because my wife is an IT project manager and while she hasn't worked with Python very much, she knows enough that she can answer any questions I have for now. Cheers
"My incompetence with power tools had been increasing exponentially over the course of 20 years spent inhaling experimental oven cleaners"
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
January 09 2020 22:34 GMT
#20293
Say you have a table with 3 important columns for some event, Id, CreationDate, and EventDate. Let's say that there are multiple entries for one person at one event, and a new entry gets created every time their information changes. How can you use SQL to grab the most recent Id and EventDate from them for each EventDate?

Say their event is from 2019-05-03 to 2019-05-08 they would have 1 entry for each of those dates. I am trying to get the Id, and EventDate with a query without tons of subqueries/joins. Is there some efficient way of doing this that I'm missing?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
Last Edited: 2020-01-10 02:27:08
January 10 2020 02:26 GMT
#20294
oops saw the example
Liquipediaasante sana squash banana
Acrofales
Profile Joined August 2010
Spain18285 Posts
January 10 2020 06:31 GMT
#20295
https://stackoverflow.com/questions/7118170/sql-server-select-only-the-rows-with-maxdate

There, that should help you in your way.

Word of caution, that table sounds rather weird... this won't give you the last time an event was entered by a single person, it'll give you the last time any event was entered for a given EventDate by anybody. You won't be able to find different events on a single day, or anything about number of participants with the table as you specified it.
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2020-01-10 12:27:11
January 10 2020 12:08 GMT
#20296
On January 10 2020 07:34 WarSame wrote:
Say you have a table with 3 important columns for some event, Id, CreationDate, and EventDate. Let's say that there are multiple entries for one person at one event, and a new entry gets created every time their information changes. How can you use SQL to grab the most recent Id and EventDate from them for each EventDate?

Say their event is from 2019-05-03 to 2019-05-08 they would have 1 entry for each of those dates. I am trying to get the Id, and EventDate with a query without tons of subqueries/joins. Is there some efficient way of doing this that I'm missing?


Not entirely sure what do you want to do. What's creation date? Is Id an uuid or a bigint? Is it auto-increment PK or FK?

If it's what I assume it is you'll have some kind of user/customer table and event table that belongs to the user/customer. In that case it's really easy.


SELECT Id, CustomerId, EventDate FROM events
WHERE CustomerId = someId
ORDER BY EventDate DESC
LIMIT 1


This gets you the most recent entry for specific customer.

What you described seems rather odd and super inefficient though. Why not just store event dates as daterange? Why create new entries upon updates if you can just update the old ones?

Edit: Let me rephrase it a bit...

There must be some way to tell which event dates belong to which group (especially that it seems you can have multiple events for the same date). Also, with the idea of creating new entries when something is changed there must be a way to tell which dates have been invalidated, what is it? All this info can help with getting what you want from the table.
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18285 Posts
January 10 2020 13:57 GMT
#20297
Oh, I missed that an event is multiple days, and therefore has multiple entries in this table. In that case the situation is even more confusing.

I suggest either redesigning your DB a bit, or giving us more information, because as is, it doesn't make sense.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
January 10 2020 16:23 GMT
#20298
It's not my DB and I can't redesign it but I have the same questions as y'all :D

I can tie the Event Snapshot(1 day of an event) to a customer, so that part I'm not worried about. What I'm trying to do is find the most recent updates to the event before a certain date cutoff. Say I'm looking before the end of March, I want to find the last Event Snapshot at the end of March. So I need to pull out the most recent Event Snapshot for that Event, but I need to do so for each date of the Event(so I can sum up revenues of the event, for example).

@Acrofales, thanks! Our DB on the backend is SQL Server but I'm trying to do this in SalesForce Developer Console(bleh) so it doesn't translate directly. I asked about SQL because I figured it was the most familiar to everyone but now I see the flaw in my plan. Do you know of a way without using any tailored SQL solution? i.e. system agnostic, using just joins and the like.
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
January 10 2020 17:30 GMT
#20299
On January 11 2020 01:23 WarSame wrote:
It's not my DB and I can't redesign it but I have the same questions as y'all :D

I can tie the Event Snapshot(1 day of an event) to a customer, so that part I'm not worried about. What I'm trying to do is find the most recent updates to the event before a certain date cutoff. Say I'm looking before the end of March, I want to find the last Event Snapshot at the end of March. So I need to pull out the most recent Event Snapshot for that Event, but I need to do so for each date of the Event(so I can sum up revenues of the event, for example).

@Acrofales, thanks! Our DB on the backend is SQL Server but I'm trying to do this in SalesForce Developer Console(bleh) so it doesn't translate directly. I asked about SQL because I figured it was the most familiar to everyone but now I see the flaw in my plan. Do you know of a way without using any tailored SQL solution? i.e. system agnostic, using just joins and the like.


Ok, so there's a way to group events by customer. Is there a way to also group them by event (multiple snapshots being a group for continuous multi-day event)? And what about invalidated snapshots like I mentioned? That's all you need really to make it work.
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18285 Posts
January 11 2020 12:49 GMT
#20300
On January 10 2020 07:34 WarSame wrote:
Say you have a table with 3 important columns for some event, Id, CreationDate, and EventDate. Let's say that there are multiple entries for one person at one event, and a new entry gets created every time their information changes. How can you use SQL to grab the most recent Id and EventDate from them for each EventDate?

Say their event is from 2019-05-03 to 2019-05-08 they would have 1 entry for each of those dates. I am trying to get the Id, and EventDate with a query without tons of subqueries/joins. Is there some efficient way of doing this that I'm missing?

Okay, without using SQL:

well, you can easily find the max(creationDate) in a loop over all the entries. Something like (in python, but converting to whatever language you like is easy):

latest_creations = defaultdict(int)
latest_ids = defaultdict(int)
for e_id, creation_date, event_date in entries:
latest = latest_creations[event_date]
entry_time = convert_to_timestamp(creation_date)
if latest < entry_time:
latest_creations[event_date] = entry_time
latest_ids[event_date] = e_id


This way, latest_ids has all the ids of the last creations for each event date. It's not too inefficient, but if your DB has a LOT of entries, then you do need to move this logic to where the data is being retrieved (the query). If you don't have access then I don't really know what you can do to speed it up.

I still don't really understand the point of this: if two events coincide in their event_date you're still screwed. But I guess that is simply impossible in whatever use case this structure is being used for.
Prev 1 1013 1014 1015 1016 1017 1032 Next
Please log in or register to reply.
Live Events Refresh
Wardi Open
11:00
#85
IntoTheiNu 1455
WardiTV996
OGKoka 461
Rex138
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 461
Rex 138
StarCraft: Brood War
GuemChi 3829
Bisu 2391
EffOrt 901
ggaemo 643
Mini 569
BeSt 507
Sexy 116
Zeus 112
Barracks 111
Sharp 107
[ Show more ]
Killer 88
Hyun 87
Pusan 70
ToSsGirL 57
Sea.KH 54
Backho 43
PianO 41
Hm[arnc] 30
soO 28
Movie 26
NotJumperer 21
IntoTheRainbow 20
Rock 19
zelot 18
GoRush 17
ajuk12(nOOB) 11
Terrorterran 10
Sacsri 7
Dota 2
Gorgc4136
qojqva1408
syndereN349
monkeys_forever152
420jenkins23
Counter-Strike
byalli393
allub332
Super Smash Bros
Mew2King297
Other Games
singsing2257
B2W.Neo1330
hiko917
Liquid`RaSZi474
Lowko312
Happy249
Hui .142
elazer83
ArmadaUGS82
Livibee58
Organizations
Dota 2
PGL Dota 2 - Main Stream55
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 15 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 20
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis2016
• TFBlade1427
• Jankos766
Other Games
• WagamamaTV335
Upcoming Events
Monday Night Weeklies
1h 46m
Replay Cast
9h 46m
Sparkling Tuna Cup
19h 46m
Afreeca Starleague
19h 46m
Snow vs Flash
WardiTV Invitational
20h 46m
SHIN vs Nicoract
Solar vs Nice
GSL
1d 19h
Classic vs Cure
Maru vs Rogue
GSL
2 days
SHIN vs Zoun
ByuN vs herO
OSC
2 days
OSC
2 days
Replay Cast
3 days
[ Show More ]
Escore
3 days
The PondCast
3 days
WardiTV Invitational
3 days
Zoun vs Ryung
Lambo vs ShoWTimE
OSC
4 days
Replay Cast
4 days
CranKy Ducklings
4 days
RSL Revival
4 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
4 days
Krystianer vs TriGGeR
Cure vs Rogue
uThermal 2v2 Circuit
5 days
BSL
5 days
Replay Cast
5 days
Sparkling Tuna Cup
5 days
RSL Revival
5 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
5 days
BSL
6 days
Replay Cast
6 days
Afreeca Starleague
6 days
Liquipedia Results

Completed

Proleague 2026-05-02
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
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
PGL Cluj-Napoca 2026

Upcoming

YSL S3
Escore Tournament S2: W6
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
Escore Tournament S2: W7
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
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 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.