Open Side Menu Go to the Top

03-29-2017 , 12:02 PM
You definitely want to decouple the processing of the music from your backend web server.

Without a ton of thinking about it, I think what you can do is something like this:

* On the front end get the file and some basic metadata (size of file - most importantly)
* Send that metadata to your back end.
* Have your back end verify that its ok to upload.
* Then have your back end construct a pre-signed url for uploading the file (This is what S3 calls it, not sure what's available for other providers). I don't remember all of the details, but you can basically restrict it to only work for a specific file and have it expire after a period of time. Should take care of most of Gull's concerns.
* Once the upload is complete, kick off some processing job that's independent from your web server (ideally), or just throttle-able in some way
* Once processing is done, kick off a notification of some sort or just wait for the user to come back.

There's some work here in maintaining state. You always want to know what stage of that pipeline you're in. Especially needs to handle random failures at any point of the pipeline.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
03-29-2017 , 12:03 PM
Quote:
Originally Posted by daveT
Ah, gotta love Heroku support, lol. That's not a proper excuse but I'll roll with it today.

***

The idea is to process the files with C and respond with music data. I'm attempting to build sheet music from the music. I have a sort of glorified tuner as a prototype for right now. Yes, lots of limits to this idea, but should be okay for what I'm trying to do.

The user can either record using the browser, or, they can record locally and upload the file. Ideally, I'd like to process the files locally and send them over the wires after. A user / student / teacher can retrieve the files at a later time. The alternative plan is to push the file to remote then process. This might be a better idea because a queue of users could blow up a dyno.

There will be a few layers between the initial upload and the end servers. I'm thinking the end servers can be without a domain, right (with all the security caveats, size limits, etc)?
100% use a domain, but you can use a subdomain. EG, your main domain is www.example.com (always use www) which is behind CF. You can create uploads.example.com which points to another environment (or the same environment) and accepts the upload, but is not shielded behind CF.

Difficulty will come if you're using and caching etc later down the line. This was a real pain point for our new website but we've gone with the idea that 200mb will be enough for forseeable future so CF will be fine.

Something you might want to look at is encoding wav to FLAC on the users browser before uploading. Storage costs are tiny so I wouldn't be worried about storing WAV's, but you want to improve upload times for end users.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 12:30 PM
Thanks, you two. It's good food for thought. Super helpful.

You'd be proud to know I never used a naked domain.

I feel like I shouldn't bother with a second server then. I'll have to do all the things that I was trying not to do by using Heroku, so it probably makes sense to keep everything localized. Would remove a lot of problems.

Regarding the caching, I would probably use nginx or varnish.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 12:45 PM
I'm not sure what the context of the project is. But there's actually a lot of 'secret sauce' type services from AWS (and I assume probably others) that would make this a lot easier.

For example, you could have the upload to S3 kick off a lambda function that does your processing, that kicks off a notification to you or your web app with the results. All fairly easy to set up and scale easily.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 12:58 PM
Sort exactly what I said, which roughly translates to I don't really know yet.

Basically, I don't want to maintain a server, though it looks like I may have to.

I don't think speed and super hot caching is a concern for this specific item. The initial upload and retrieval wouldn't​ be that fast, and my intuition thinks later retrievals will happen either a few times for curiosity or not at all. Adding a way to share file links feels a bit pointless. The person is really practicing scales and other small stuff.

Basically, what you describe is what I'm after. Send a file, process, send back XML to the database, serve up the music file.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 12:59 PM
Quote:
Originally Posted by jjshabado
I'm not sure what the context of the project is. But there's actually a lot of 'secret sauce' type services from AWS (and I assume probably others) that would make this a lot easier.

For example, you could have the upload to S3 kick off a lambda function that does your processing, that kicks off a notification to you or your web app with the results. All fairly easy to set up and scale easily.
jj,

which ones have you used personally?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 01:19 PM
S3 (including pre-signed urls) and the notification services.

Never used lambda, but seemed fitting. The old school version (which I have done) is to send a message to SQS with a separate worker app that pulls work from there. Think of it as your own lambda.

I wasn't really advocating for those specific tools - as much as trying to make the point that there are lots of times where you shouldn't bother re-inventing the wheel and should just use a cloud provider for all of the plumbing. I included those specific tools above to try to make it a bit more concrete.

An application that uploads files, processes them, and returns some results to the user isn't particularly novel. There are lots of tools/services out there that can get you up and running quickly and with a scalable solution. I'm not even particularly convinced the AWS (or other) approach would be more expensive in the short-term.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 01:32 PM
yeah, agreed. AWS is just one of those things I've only used a tiny bit, but I know it has infinite services so was just curious.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 01:42 PM
I've used quite a few AWS services over the years. Most of the data/big-data related ones (Redshift, Dynamo, RDS, EMR) and a fair number of the 'plumbing' type services. I haven't touched most of the newer services or those focused more on consumer apps.

In general, they're usually pretty good at what they say they do. They just often don't do something that you would assume it would do. AWS is very good at the MVP. And they have horrendous UI/Usability.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 02:00 PM
Come on, the one giant dash board to rule them all is simple the 5th time you find the widget you're looking for... I don't understand how S3 can require unique names, I must have read that wrong.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 02:03 PM
It's just a matter of limiting the # of buckets a customer can have. Lots of unique names possible.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 03:40 PM
Quote:
Originally Posted by jjshabado
S3 (including pre-signed urls) and the notification services.

Never used lambda, but seemed fitting.

I'm not even particularly convinced the AWS (or other) approach would be more expensive in the short-term.
This might actually work.

Those numbers are so large -vs- micro-pennies and my project is definitely not "big." I'm planning to open up beta for 10 people max to start, so at least can get some baselines.

If I did the DO route, it would be minimum $20 / month. I doubt I could hit that on AWS unless I create a miracle of user zombification. Give it a month-long test before I can return with a data point of 1 person.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 04:24 PM
Anyone used Railgun before? It's insanely, insanely good (if you can get it going, having teething issues!) and is a really clever bit of infrastructure.

Our azure environment is in east US, (with google analytics disabled) can cold load our homepage in ~250ms from London, ~190ms from Dallas. (21 requests, 240kb)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 06:34 PM
hey friends,

so I had an interview with a company about 2 weeks ago, where at the end they clearly told me that I've past this stage of the process and the next stage will be an online assessment, however its been 2 weeks and I haven't heard anything from them? whats the best way to play this? do I contact them or wait a little longer? <3
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 06:39 PM
I'm waiting for the same thing, I don't think there is any way you can talk yourself into a job in this situation and is a small chance you could talk yourself out of one. Keep looking for a job until you have an offer. Worst case you can contact the first company with the offer from a second company.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 06:39 PM
just prod them. HR is probably being lazy; guy took a vacation last week and stuff got dropped on the floor.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 06:50 PM
+1 to prod them. Just be polite and professional.

The tiny chance of talking yourself out of a job is offset by the tiny chance you fell through the crack and you end up getting a job when you wouldn't have without prodding.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 06:54 PM
yeah, i'll probs email them tomorrow
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 11:00 PM
DrSo after 3 days of lectures and moving what I felt like was slow, they just dropped a homework assignment that torched the class.

As of right now only 5 (out of 21) people have any code on github and only me and 1 other student have working solutions (mine is much better but who's paying attention to that )

It was a word problem to build a program that solved for number of stops between trains, having 3 different lines that shared a common station. Had to figure out how to store the data, and how to accept arguments in the form of numberOfStops(departing line, departing station, arriving line, arriving station).

I'm at the point where once i have the "solution" in my head it takes an hour or two to get it down into working code. Need to improve with things like grunt, writing tests, and debugging immediately.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-29-2017 , 11:18 PM
Just don't be the douchebag who thinks his code is always the best plz

We have enough of those
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-30-2017 , 01:19 AM
I will definitely avoid that. I wanna just be a chill programmer, not a douche brogrammer.

This homework is setting up for a contentious day tomorrow.

We have a few people in the class who are really defensive of their lack of knowledge while also being somewhat arrogant. I'm not sure if that is the right way to put it but here are some comments from a pull request that just came in. This dude actually seemed chill from speaking to him at lunch:

Spoiler:
I did this with the help of professional developer and I feel that with the time spent on these topics this was so far off base from the material taught that I did'nt know where to begin, We had to use Math.abs and indexOf multiple times to complete the tests and it has never even been shown or hinted at, the tests themselves were so advanced that without the help of my friend I could barely read and comprehend


I've been improving my code all night and am passing all tests now and _dave_ even helped me optimize a couple lines. If things slow down again tomorrow, I'm gonna try and keep my individual pace going.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-30-2017 , 01:27 AM
Quote:
Originally Posted by PJo336
Just don't be the douchebag who thinks his code is always the best plz

We have enough of those
Eh, when you first start, why not pat yourself on the back a little bit?

Larry, put this comment at the top of every file you write:

Code:
// I am sooooo sorry.
You may not know why today, but you will know in 6 months.

While your at it, don't forget to put reasonable limits on the inputs or some way to time out, preferably between now and the heat death of the universe.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-30-2017 , 09:37 AM
Quote:
Originally Posted by Larry Legend
I will definitely avoid that. I wanna just be a chill programmer, not a douche brogrammer.

This homework is setting up for a contentious day tomorrow.

We have a few people in the class who are really defensive of their lack of knowledge while also being somewhat arrogant. I'm not sure if that is the right way to put it but here are some comments from a pull request that just came in. This dude actually seemed chill from speaking to him at lunch:

Spoiler:
I did this with the help of professional developer and I feel that with the time spent on these topics this was so far off base from the material taught that I did'nt know where to begin, We had to use Math.abs and indexOf multiple times to complete the tests and it has never even been shown or hinted at, the tests themselves were so advanced that without the help of my friend I could barely read and comprehend


I've been improving my code all night and am passing all tests now and _dave_ even helped me optimize a couple lines. If things slow down again tomorrow, I'm gonna try and keep my individual pace going.
Hopefully I didnt come off like the dbag there...lol

To me that was actually the most fun part of learning/school, was getting crazy **** thrown at you because figuring it out feels so damn good. Plus thats kind of how engineering works anyways. That said its a pretty stressful process so I can totally understand people freaking out/complaining a lot.

Quote:
Originally Posted by daveT
Eh, when you first start, why not pat yourself on the back a little bit?

Larry, put this comment at the top of every file you write:

Code:
// I am sooooo sorry.
You may not know why today, but you will know in 6 months.

While your at it, don't forget to put reasonable limits on the inputs or some way to time out, preferably between now and the heat death of the universe.
Good to see you back dude
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-30-2017 , 10:09 AM
Quote:
Originally Posted by PJo336
To me that was actually the most fun part of learning/school, was getting crazy **** thrown at you because figuring it out feels so damn good. Plus thats kind of how engineering works anyways. That said its a pretty stressful process so I can totally understand people freaking out/complaining a lot.
+1

The attitude that student has is a very bad sign for that person. I have been 'tutoring' students of an online code school since October and I have noticed a few students who find it absolutely incredulous that a lesson didn't outline everything to the T required to complete a lab. Often times these lessons/labs actually do include links to supplemental reading or videos which actually explain the methods or concepts more in-depth. It's one thing to learn a bit slower and need clarification about concepts, it's another to be douchey about OMG they had to use google and actually learn something.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-30-2017 , 10:23 AM
The best part of classroom learning is showing up everyone else, you can't do it at work, you can't do it amongst your friends, but in a class go ahead and break the curve. It's also funny that someone is taking a book camp and complaining that it's hard.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m