|
At a high level, how do I scan a video file and look for audio jingles? I have an .avi file and I'd like to know how many times a specific 3-second jingle is played in that file.
|
# ? Jun 21, 2017 02:54 |
|
|
# ? May 31, 2024 17:29 |
|
Hughmoris posted:At a high level, how do I scan a video file and look for audio jingles? I have an .avi file and I'd like to know how many times a specific 3-second jingle is played in that file. The basic concept would be to do a Fourier transform of the audio stream from the video and of the jingle you're looking for, and then do a cross-correlation. The peaks in the cross correlation should correspond to the time coordinates where the jingles occur.
|
# ? Jun 21, 2017 04:32 |
|
B-Nasty posted:I have a TP W541, and it's generally been pretty decent. It's heavy, and brick-like, but I would expect that given it's specs. Yeah, my T550 has a 3K screen as well, which means it's an endless battle to get non-DPI-aware programs like Steam to not be poo poo. For some reason Lenovo only offers IPS screens in 3K, at least for that model; if you want 1920x1080 you have to get TN.
|
# ? Jun 21, 2017 12:58 |
|
I have a P70, the only part I'd call flimsy is a little area at the top left above the Escape key where I can tap the plastic and it makes a little click. Otherwise it's been quite solid. My major complaint would be that, while the battery life is serviceable (lasts through the morning or the afternoon), it annoys me that the useless DVD drive cannot be replaced with an extra battery, as in older models. You can only use the bay for another hard drive, which I definitely don't need (there's two m.2 slots and a 2.5" one already), whereas a second battery would make it drat near perfect.
|
# ? Jun 21, 2017 13:18 |
|
TooMuchAbstraction posted:The basic concept would be to do a Fourier transform of the audio stream from the video and of the jingle you're looking for, and then do a cross-correlation. The peaks in the cross correlation should correspond to the time coordinates where the jingles occur. Thanks. It's been 10+ years since I've thought about FT. I'm hoping I can find something in Python that does most the work. Provide audio file and sound query, and have it spit out a timestamp.
|
# ? Jun 21, 2017 19:00 |
|
Hughmoris posted:Thanks. It's been 10+ years since I've thought about FT. This might work for you
|
# ? Jun 21, 2017 19:06 |
|
And if it doesn't, scipy has fourier transform and cross-correlation functionality.
|
# ? Jun 21, 2017 19:28 |
|
TooMuchAbstraction posted:The basic concept would be to do a Fourier transform of the audio stream from the video and of the jingle you're looking for, and then do a cross-correlation. The peaks in the cross correlation should correspond to the time coordinates where the jingles occur. Someone's gonna win all the tickets from the 107.7 WRKR Summer Sweepstakes. NihilCredo posted:I have a P70, the only part I'd call flimsy is a little area at the top left above the Escape key where I can tap the plastic and it makes a little click. Otherwise it's been quite solid. This really bugs me, my first laptop was a Fujitsu Lifebook T4220 and I could use a bay battery, it hugely improved battery life over the standard 6-cell or w/e. Not being able to use bay batteries on modern Thinkpads is a major bummer. My laptop significantly predates M.2 however so I do still use the bay for a spinning HDD for bulk storage.
|
# ? Jun 21, 2017 20:03 |
|
Hi! Does anyone have any recommendations on books / papers / literature on modern compiler and programming language design?
|
# ? Jun 21, 2017 23:39 |
|
TooMuchAbstraction posted:And if it doesn't, scipy has fourier transform and cross-correlation functionality. Thanks, I'll give these a look.
|
# ? Jun 21, 2017 23:48 |
|
Anyone point me towards some good reading on setting up distributed 'serverless' components? Specifically how service discovery is normally handled? I have a thing where I want multiple "agents" to talk to the nearest available "collector" and the "collector" would forward any data it receives to a database. I want the agents to be able to automatically discover which collector would be the best for them to send to, and if one collector goes offline, start sending data to the next one. My initial thought is to use dns, but I feel like some people much smarter than me have solved this problem, but am having a hard time finding good information.
|
# ? Jun 22, 2017 20:13 |
|
The Fool posted:Anyone point me towards some good reading on setting up distributed 'serverless' components? Specifically how service discovery is normally handled?
|
# ? Jun 22, 2017 20:22 |
|
The Fool posted:Anyone point me towards some good reading on setting up distributed 'serverless' components? Specifically how service discovery is normally handled? IETF is your friend here. If you like reading anyway. using DNS using reload Reload base
|
# ? Jun 22, 2017 21:14 |
|
Just wondering if there are any more practice examples/problems for newbie programmers... The job megathread indexes these: Practice practice practice Talentbuddy - a bunch of interview-esque programming challenges Project Euler - a series of challenging math/CS problems that starts easy and gets hard CareerCup - the company that makes "Cracking the Coding Interview" Topcoder - a site about programming competitions CoderByte - Small programming challenges organized into 3 difficulty bands CodeKata - A popular series of programming exercises I'm sure these are the most popular but are these the only ones out there? I remember there was one that was really effin long and you could compete with anyone in the world. Nobody has been able to find that particular site for me after I first found out about it. Prob cus the forum i found it on has long since wiped their forums clean for whatever reason... Big up to anyone who can help me here, Im trying to get my hands on anything and everything that falls under practice examples/problems. (Off topic: Is there a way to "thank" people on this forum? Seems like the somethingawful members are helping me more and more everyday.)
|
# ? Jun 23, 2017 16:08 |
|
tricksnake posted:Just wondering if there are any more practice examples/problems for newbie programmers... The job megathread indexes these: Codefights Codewars HackerRank Leetcode
|
# ? Jun 23, 2017 16:15 |
|
tricksnake posted:Just wondering if there are any more practice examples/problems for newbie programmers... The job megathread indexes these: There are a bunch of them, but none come to mind immediately. Some require a paid subscription. Typically "thanks" are through purchasing avatars or the like.
|
# ? Jun 23, 2017 16:17 |
|
Not really a programming question, but: is there a way to verify that an email address is legit? I'm getting gas service set up at my apartment and I was told to send scans of two pieces of identifying documentation to an email address that I can't immediately verify exists (neid@nationalgrid.com). I'm skeptical of this, so I wanted to make sure the email was legit and I didn't somehow get intercepted by some scammer or something. Google didn't get me anything. Is there an email lookup out there or something?
|
# ? Jun 23, 2017 16:21 |
|
Pollyanna posted:Not really a programming question, but: is there a way to verify that an email address is legit? I'm getting gas service set up at my apartment and I was told to send scans of two pieces of identifying documentation to an email address that I can't immediately verify exists (neid@nationalgrid.com). I'm skeptical of this, so I wanted to make sure the email was legit and I didn't somehow get intercepted by some scammer or something. Google didn't get me anything. Is there an email lookup out there or something? Send an email to it and see if it bounces. E: actually read your thing. Make sure that the domain is owned by the organization you think it should be owned by. Do a whois.
|
# ? Jun 23, 2017 16:33 |
|
Jose Valasquez posted:Codefights https://www.codingame.com/ can be fun, too, but fair warning: I've had solutions that pass locally and fail on their server-side verification, which really frustrating because 'Faled' is all the feedback you get for those AFAICT.
|
# ? Jun 23, 2017 16:37 |
|
leper khan posted:Send an email to it and see if it bounces. The whois checked out so I guess it's real. Thanks! loving hate dealing with companies sometimes.
|
# ? Jun 23, 2017 16:57 |
|
Jose Valasquez posted:Codefights thanks homie
|
# ? Jun 23, 2017 18:36 |
|
This is not really related to any programming language in particular so: How dumb am I for wanting to setup my own Open Streetmap tileserver? Really dumb, or just dumb? I need some tileserver, especially the seamap one's, and the fair use policy of OSM's own servers sound kind of restrictive. Especially now that I am still actively working on stuff I fear I might misuse their services.... I saw the setup guides for your own server and holey moley.
|
# ? Jun 24, 2017 11:41 |
|
When using a purely function language where "variables" are not re-assignable, is there any sort of approach to creating a "running sum" type of function, that takes a list as input, and returns another list, where each element's value depends on the previous one, and do this in a non retarded way ( that means it should take no more than O(n) time ) so for example: running_sum([1,2,3,4,5,6,7,8,10]) would return: [1, 3, 6, 10, 15, 21, 28, 36, 45, 55] The language in question is OpenSCAD, but I don't expect a large number of people to be familiar with it, so I'm wondering about a more general solution.
|
# ? Jun 24, 2017 17:39 |
|
peepsalot posted:When using a purely function language where "variables" are not re-assignable, is there any sort of approach to creating a "running sum" type of function, that takes a list as input, and returns another list, where each element's value depends on the previous one, and do this in a non retarded way ( that means it should take no more than O(n) time ) The normal thing to do is recursion and pass your state as an argument. Haskell: code:
code:
|
# ? Jun 24, 2017 17:44 |
|
Mr Shiny Pants posted:This is not really related to any programming language in particular so: Maybe a docker container would be easier? https://github.com/geo-data/openstreetmap-tiles-docker/blob/master/README.md
|
# ? Jun 24, 2017 17:58 |
|
The Fool posted:Maybe a docker container would be easier? Might be worth a shot, thanks.
|
# ? Jun 24, 2017 18:20 |
|
ShoulderDaemon posted:The normal thing to do is recursion and pass your state as an argument. Haskell:
|
# ? Jun 24, 2017 18:23 |
|
peepsalot posted:When using a purely function language where "variables" are not re-assignable, is there any sort of approach to creating a "running sum" type of function, that takes a list as input, and returns another list, where each element's value depends on the previous one, and do this in a non retarded way ( that means it should take no more than O(n) time ) You would typically use "scan" pre:scala> val ns = 1 to 10 ns: scala.collection.immutable.Range.Inclusive = Range(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) scala> ns.foldLeft(0)(_ + _) res0: Int = 55 scala> ns.scanLeft(0)(_ + _) res1: scala.collection.immutable.IndexedSeq[Int] = Vector(0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55)
|
# ? Jun 24, 2017 18:30 |
|
I don't have a scan function either, so what does the implementation of scan look like? Oh yeah and also the language is not actually functional in the sense that it can even support higher order functions (functions are not first class). peepsalot fucked around with this message at 18:45 on Jun 24, 2017 |
# ? Jun 24, 2017 18:37 |
|
peepsalot posted:When using a purely function language where "variables" are not re-assignable, is there any sort of approach to creating a "running sum" type of function, that takes a list as input, and returns another list, where each element's value depends on the previous one, and do this in a non retarded way ( that means it should take no more than O(n) time ) In addition to the accumulator solution ShoulderDaemon mentioned it might help to know that this problem has a name: prefix sum. Most functional languages will have support for computing prefix sums out of the box with some arbitrary binary operator (not just + as with the example numerical running sum), as well as possibly also parallel prefix sum implementations. In Haskell the general prefix sum is called scanl and "canonical" solution here would be code:
code:
E: Well, I'm late to the party. Anyhow, in conclusion, you may be doomed to O(n^2). It might be possible to wring what you want out of their list comprehension syntax, but far as I can tell it just allows for filter + map combinations which is not sufficient. Of course, it's not like I actually know OpenSCAD. Xerophyte fucked around with this message at 19:00 on Jun 24, 2017 |
# ? Jun 24, 2017 18:51 |
|
Mr Shiny Pants posted:This is not really related to any programming language in particular so: I set up a nominatim server a couple months ago. It was straightforward, but they're not joking about resources or time. If you do a bunch of GIS stuff though it could be really useful to set up some of their stuff. If you're worried about license stuff, you could just use it internally then switch to whatever other provider in stage and prod.
|
# ? Jun 25, 2017 13:50 |
|
Do you have a guide handy that you used? I've tried photon, which is Nomitatim server written in Java, but that did not work as well as I hoped. I now use OpenCage en they have a very nice API and a free usage tier which actually makes it possible to do anything.
|
# ? Jun 25, 2017 14:43 |
|
Does anyone know a command line metronome program that exists for Windows? https://www.npmjs.com/package/metronome.js fits with what I want re command arguments, but it only works on a Mac. I think I've never programmed anything that has to emit sounds. I assume that this would be easy enough to whip up in c#? I still have visual studio installed on my computer.....
|
# ? Jun 25, 2017 22:03 |
|
I'm attempting to write a GUI program using Eclipse and MinGW in C/C++. I'm doing this specifically because I'd like to get away from using Visual Basic for the little programs I write for myself, and from Visual Studio/Windows entirely. [On Windows 10] I have gotten Eclipse and MinGW to work, and I can get the blank window example on this page to work: http://www.winprog.org/tutorial/simple_window.html What I cannot figure out how to do is how to add any useful controls to the window. I cannot find any examples online that show that, that aren't Visual Studio examples. Years back when I was in school we learned (basically) how to do this, and you could just type all the code into the main file. So I have written small Windows C++ programs this way in the past; I just can't recall exactly how. You set the positions and sizes just by setting X-Y coordinates for each.... but the other examples on that website above don't show that. They add several controls at once (so it's not obvious what any part of the whole thing is doing) and use a Visual Studio project that has the control settings in a separate resource file. What I'm remembering is like this example on the MS site-- https://msdn.microsoft.com/en-us/library/windows/desktop/hh298354(v=vs.85).aspx but that example won't work when copied and pasted anywhere into the previous window example. Is there anywhere online that shows this? Like: FIRST they show the code for a blank window, and then they show code that has one button/one textbox/ect added to the same previously blank window. Or can you even write the controls in-line anymore? Do you have to set the controls in a separate rc file now?
|
# ? Jun 25, 2017 22:20 |
Newf posted:Does anyone know a command line metronome program that exists for Windows? https://www.npmjs.com/package/metronome.js fits with what I want re command arguments, but it only works on a Mac. This could probably be done in 10 lines of PowerShell. Basically create two System.Media.SoundPlayer objects, one for each of the 'tick' and 'tock' sounds, and then have a loop playing them with an appropriate delay between. Would be equally simple to do in C# yes.
|
|
# ? Jun 25, 2017 22:51 |
edmund745 posted:I'm attempting to write a GUI program using Eclipse and MinGW in C/C++. First, if you say you intend to move away from Windows entirely, why learn to program against the Win32 API? Nothing wrong with learning it, it's just not useful anywhere else. But what you want to do, to make the Button example code you linked work, is create your controls in your WM_CREATE message handler on the main window. It isn't handled explicitly in the blank window sample you shave, so you'll have to add it to your WndProc switch.
|
|
# ? Jun 25, 2017 22:59 |
|
Mr Shiny Pants posted:Do you have a guide handy that you used? I've tried photon, which is Nomitatim server written in Java, but that did not work as well as I hoped. their wiki has a step-by-step
|
# ? Jun 25, 2017 23:16 |
|
nielsm posted:First, if you say you intend to move away from Windows entirely, why learn to program against the Win32 API? Nothing wrong with learning it, it's just not useful anywhere else. quote:But what you want to do, to make the Button example code you linked work, is create your controls in your WM_CREATE message handler on the main window. It isn't handled explicitly in the blank window sample you shave, so you'll have to add it to your WndProc switch. Eclipse says "error: a label can only be part of a statement and a declaration is not a statement" at the first line of the added button-crating code. (the parent window handle is edited correctly already) [edit added] Ya know what? Nevermind. Netbeans/Java meets my original desires and seems to be a lot easier to use anyway. edmund745 fucked around with this message at 01:20 on Jun 26, 2017 |
# ? Jun 25, 2017 23:49 |
|
I have the following situation (abstracted a bit): I have a set of N objects and a set of things T. Each thing t has k ordered slots that can be filled with unique objects from N, as long as certain constraints between the slots are fulfilled. These constraints are essentially of the form "n1.variable = n2.variable". As a special thing, the constraints are tied to the slots and the constraints between two slots only "look backwards": there is no way to know from looking at slot number 1 whether some later slot i has a constraint that refers to slot 1. Now the task I'm being given is essentially this: "Given a certain initial object n, belonging to N, find any t in T that can be filled with items from N so that n is in the first slot of t. This seems to me like a constraint optimization problem but I've not dabbled with them before. The trivial solution seems to be to loop over T, doing for each t a depth-first-search to determine whether the constraints can be fulfilled. As we are satisfied with any solution, we just stop when the first one is found. But event this takes an annoyingly long time (as in, "will cause problems down the line") and I'm wondering whether there's some technique I should be looking into. If it helps, most of the things in T actually only have very few slots that need to be filled (the distribution is something like 50% have 1 slot, 25% have 2 slots, 12.5% have 3 slots, etc.) and most of the constraints are "looking backwards" at the first slot. The size of N, however, is relatively large (in the order of millions). The process is called very often and T is small and constant but shuffled between the calls. At the same time, N is in practice not known beforehand. We know it is some subset of an enormous dataset D that takes most of the working memory. I'd like to avoid solutions that entail adding more metadata to D. Any hints on where to start looking or what to start reading would be greatly appreciated. Loezi fucked around with this message at 15:28 on Jun 27, 2017 |
# ? Jun 27, 2017 15:23 |
|
|
# ? May 31, 2024 17:29 |
|
Two questions: Every thing t has a different number of slots? All the slots of a thing t have to be filled to satisfy to condition?
|
# ? Jun 27, 2017 15:38 |