Open Side Menu Go to the Top

10-21-2016 , 11:29 AM
npm is garbage and will be ultimately be one on the long list of failed attempts to make money off an idea that they somehow got first to market in and then failed to do anything with over 5 years. "NPM, inc" really??
** 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 **
10-21-2016 , 05:22 PM
Maybe just sample size but... Does anybody ever format html/css or is it just always 200 300-character-long lines mashed together with no blank lines and inconsistent indentation?
On that note, I <3 the auto-indent feature in Atom.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-22-2016 , 02:55 AM
Quote:
Originally Posted by SiQ
Maybe just sample size but... Does anybody ever format html/css or is it just always 200 300-character-long lines mashed together with no blank lines and inconsistent indentation?
On that note, I <3 the auto-indent feature in Atom.
No, many frameworks minimize HTML during compilation. No one (well, I HOPE) write minimized HTML, CSS, JS, or anything, by hand.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-22-2016 , 04:06 AM
So, I been thinking about and interesting problem I have, and I'm thinking about building it out. I was talking to a few fellow musicians about this idea, and they are kind of "I'd probably use it, but it better be ****ing good."

As you may know, there are a few sites, like utab and chordify that attempt to convert music from YouTube or SoundCloud into music. They seem to work okay, but they only give out chords, which isn't very good for videos like this:

https://www.youtube.com/watch?v=boELLz-_BXk

or this:

https://www.youtube.com/watch?v=G1bzUaf_gvU

If you put them into utab or chordify, you get chords. Granted, chords can help with pointing the way, but you have to figure out the rest yourself. This isn't always a bad thing, but I've found myself manually transcribing a few pieces I'd like to learn, and that's time consuming and painful. In other cases, like if I wanted to play the Adele song, I can find the piano music, download it, and create my own interpretation. Of course, I can figure out some stuff by ear, but having chords to look at with lyrics makes things a lot easier.

Other sites are using uploaded sheet music or tabs and doing highlighting as you play along, but this only works if the site already has sheet music or tabs uploaded, which means you'd be SOL if you wanted to play either of the linked pieces.

I would like to try to automate the process of manual transcription which outputs sheet music and / or tabs. It appears that it can be done for monophonic music (solo instrument), though I can't be sure how difficult it is to get past say, 90% accuracy.

I do know that converting polyphonic music has been an open question for 30 years now, and while there is some progress, it isn't that far along yet.

As I understand it all so far, you would, at minimum, need an FFT -> to some analyzer. There are multiple ways to analyze all of this, and they all seem like interesting approaches. Since I've already been encoding music theory, I think having quite a bit of that information would help with doing the approximations. There are quite a few neat white papers on this subject.

Unfortunately, this is a legal snake's pit and I'm not well-versed enough in music licensing to understand how it all works. I think the going trend now days is make money, don't spend it, back pay or get sued out of existence since it is apparently very difficult to get permission from each individual publisher, so they send a take down notice*. I guess the alternative is just open source the entire project, file it under education / research, and write a ton of articles on the implementation issues. Then it is a matter of figuring out if it is something that should be only available for download or hosted on a site somewhere.

* interestingly, I interviewed with a company who sent these take down notices. At 2 1/2 hours, it was the longest interview I ever been in, but truly mind-expanding and interesting.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-22-2016 , 12:16 PM
Identifying the content of polyphonic music is an *extremely* hard problem. I'd recommend looking at the polyphonic version of Celemony Melodyne, which is probably the gold standard in this regard. I don't know what it sells for now but when it came out it was a LOT.

I made a monophonic transcriber once, it wasn't bad. It wasn't as good as melodyne's mono version though - melodyne is really something else. It doesn't just capture the note values, it also captures the dynamics, and lets you edit the note values while keeping (or modifying!) the dynamics. Such a piece of magic.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-22-2016 , 04:16 PM
I went to a 1-day conference by these guys: http://scna.softwarecraftsmanship.com/ followed by a half day code workshop (which I am at now). Really enjoying both. I feel energized again. It's nice to talk code again with a bunch of people who really care.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 05:03 AM
Quote:
Originally Posted by RustyBrooks
Identifying the content of polyphonic music is an *extremely* hard problem. I'd recommend looking at the polyphonic version of Celemony Melodyne, which is probably the gold standard in this regard. I don't know what it sells for now but when it came out it was a LOT.

I made a monophonic transcriber once, it wasn't bad. It wasn't as good as melodyne's mono version though - melodyne is really something else. It doesn't just capture the note values, it also captures the dynamics, and lets you edit the note values while keeping (or modifying!) the dynamics. Such a piece of magic.
That looks interesting, but definitely not what I'm attempting to do. I want to automatically create sheet music and tabs. MuseScore is probably much better with a MIDI, but manual entry is considerably slower than using pencil and paper.

The process should be like this: I take a recording of myself, push it into the program, and it spits out sheet music. If this is even 80% accurate and have to do the rest by hand, I'd be pretty darn happy.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 06:21 PM
If I'm going to make a site with "video posts" where each can be in many categories, and you can view all videos in a specific category, is using mongodb a dumb decision? I have rudimentary sql skills so can imagine how these sql queries would work but mongodb is so easy and tempting to use.

Also, say you were looking over a prospective employee's github and saw him using mongodb here instead of some sql database, what would you think?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 06:32 PM
IMO, if your data can be described with a simple, constant, and unchanging data model, then mongodb isn't the right choice. Setting up a SQL table or two is just as easy, imo.

I have seen a lot of people who are unhappy they chose mongo and kinda got stuck with it. I have seen less people who have chosen a SQL database who regret it.

I have been handed a lot of mongo projects where I definitely regretted my predecessor choosing it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 07:50 PM
Quote:
Originally Posted by suzzer99
I got the impression the global cache was local to that machine/VM - like NPM's cache. I guess if there's a shared global cache that could work. Still though, assuming that is the case - if you have computers you don't want on the internet, it's not that safe to have them connected indirectly (via this global cache, where ever it lives) to a computer that is connected to the internet.

It's long been my biggest complaint with NPM that they don't just write the ability to check multiple caches into the client. IE - check local, if it's not there - go to npmjs.com. I've gone around and around with Forrest Norvell on twitter about it a few times. He pretends not to understand why this would be useful, but then ultimately tries to pitch npm enterprise.

Gee what's simpler - client checks one repo first, if the package isn't there it goes to another repo vs. set up and maintain an internal npm repo/proxy server somewhere that everyone has access to?
There can be centralized local network/DC cache that's not publicly accessible. That's actually what we do for ruby gems. We use geminabox to host our private gems in our own DC. We also have a mirror of rubygems because rubygems was rate limiting us (we download gems when setting up clean environment for each build).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 08:59 PM
Quote:
Originally Posted by Prickly Pear
If I'm going to make a site with "video posts" where each can be in many categories, and you can view all videos in a specific category, is using mongodb a dumb decision? I have rudimentary sql skills so can imagine how these sql queries would work but mongodb is so easy and tempting to use.

Also, say you were looking over a prospective employee's github and saw him using mongodb here instead of some sql database, what would you think?
I'm the farthest from a db expert but mongo is fine imo for prototyping/MVP and certainly wouldn't think bad of someone using it especially node people. Millions of users then yeah use something else.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 09:44 PM
Everyone who thinks they're making a prototype is either making trash that no one will ever use, or a real system that's going into production tomorrow. The idea that it'll get rewritten the right way in the near future is a joke. Write your **** right the first time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 10:00 PM
That's a pretty terrible generalization.

Quote:
So when I asked, "What's the simplest thing that could possibly work," I wasn't even sure. I wasn't asking, "What do you know would work?" I was asking, "What's possible? What is the simplest thing we could say in code, so that we'll be talking about something that's on the screen, instead of something that's ill-formed in our mind." I was saying, "Once we get something on the screen, we can look at it. If it needs to be more we can make it more. Our problem is we've got nothing."

I think that that's a breakthrough, because you are always taught to do as much as you can. Always put checks in. Always look for exceptions. Always handle the most general case. Always give the user the best advice. Always print a meaningful error message. Always this. Always that. You have so many things in the background that you're supposed to do, there's no room left to think. I say, forget all that and ask yourself, "What's the simplest thing that could possibly work?"
http://www.artima.com/intv/simplest3.html
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 10:35 PM
Well...

I've been doing this for 20 years. And I've seen it from both sides.

I have written things that I knew were going to go straight into production, that I justified by saying "it's a prototype" so people would get off my back about best practices.

And, I've dealt with the aftermath of the above, where it quickly became a real, and very piece of ****, non-prototype.

Sometimes I was right to shrug off the best practices, sometimes not. Same goes with other people's stuff. But the go-to of "it's just a prototype" as a justifcation for taking the easiest path is bull****.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 11:41 PM
Interesting. Most of the devs I work with want to be really dogmatic about "best practices". Where best practices is some amalgamation of **** that doesn't matter or doesn't account for context. Like bringing in all of handlebars js because we have 40 lines of code that could be a template! Or 100% test coverage.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-23-2016 , 11:51 PM
Mongo is fine "for Production". And nobody is going to change their mind about recruiting/interviewing/hiring someone because of their database choice in a personal project.

Quote:
Originally Posted by RustyBrooks
Everyone who thinks they're making a prototype is either making trash that no one will ever use, or a real system that's going into production tomorrow. The idea that it'll get rewritten the right way in the near future is a joke. Write your **** right the first time.
Yeah, this is bad. The "unused trash" or "real system" seems like a ridiculous simplification. Not to mentioned you probably don't even know what "the right way" is until your **** is in Production. Release early, release often.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-24-2016 , 03:08 AM
God damn mother****ing son of a bitch.

I'm midway through doing a small pet project to learn Angular 2 and am using ASP.NET Web API with a Mongo database. Mongo provide a .NET driver. As most of you probably know, Mongo uses a bastardised form of JSON internally, called BSON. Query results come in to .NET as a BsonDocument object. Happily, the driver provides a .ToJson() method that converts the object to plain JSON.

Unhappily, as I just spent two hours finding out, if you just call that, it cheerfully produces invalid JSON. You have to call this instead:

Quote:
.ToJson(new JsonWriterSettings { OutputMode = JsonOutputMode.Strict });
whereupon it's all "Oh you want valid JSON? Sure, I can do that, why didn't you say so?".

After wasting 2 hours on this problem, I then wasted an additional 15 minutes or so daydreaming about punching the face of whoever thought it was a good idea to have a ToJson method return invalid JSON by default.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-24-2016 , 03:13 AM
Quote:
Originally Posted by RustyBrooks
Identifying the content of polyphonic music is an *extremely* hard problem.
I thought I touched on this in my post. I was aware that polyphonic is still an unsolved problem. One study I found showed, at best, about 85% accuracy.

I'm going to focus on monophonic music and go from there. This will be hard enough as it is, and the more I read and think about it, the more I appreciate how difficult this is going to be.

I've been thinking about a good project for finally really getting a hang of C. I feel like this will be among the worst ways to go about it, but oh well.

Quote:
Originally Posted by Prickly Pear
mongodb is so easy
I don't think it's that easy.

Use MongoDB because that is what you are familiar with, what you are good at, or what you want to learn; don't use MongoDB because you assume it is easier than SQL. You still have an idea of data models in MongoDB, and JSON.

I think k/v stores are a more intuitive and better design for NoSQL databases.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-24-2016 , 03:15 AM
btw Angular 2 seems fine other than that it's pretty heavyweight and has a bit of a brutal learning curve. I've found it more difficult to learn than Angular 1.x. It's a bit kind of "oh you want to make an HTTP request? lol that's advanced stuff my naive friend, here go spend half an hour learning about RxJS Observables".
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-24-2016 , 03:34 AM
"Easy" is whatever you're used to. Using SQL for a task like that would be vastly easier for me than Mongo because I've only started using Mongo in the last few days.

I'd use SQL because it seems like your data is relational, so use a relational store.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-24-2016 , 04:04 AM
For those that remember the TIS-100 thread, same guy made a new, similar-but-different game called Shenzhen I/O. It takes the same assembly programming concept and expands it to the domain of embedded devices, so you're programming microcontrollers and hooking them up together to build circuits that perform the specified tasks.

Pretty fun so far. My employer actually does work in Shenzhen building stuff so I imagine the hardware guys I work with would probably get a kick out of this.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-24-2016 , 11:49 AM
Quote:
Originally Posted by jjshabado
Mongo is fine "for Production". And nobody is going to change their mind about recruiting/interviewing/hiring someone because of their database choice in a personal project.



Yeah, this is bad. The "unused trash" or "real system" seems like a ridiculous simplification. Not to mentioned you probably don't even know what "the right way" is until your **** is in Production. Release early, release often.
I would agree with this. Dan North talks about this in this excellent talk. A lot of the time your hack saves time because you skipped work that would have become redundant.

https://youtu.be/USc-yLHXNUg?t=15m38s
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-25-2016 , 01:21 PM
Quote:
Originally Posted by goofyballer
Chatting with a potential vendor today (this is for something I manage at work wholly unrelated to programming) and they sent me a link to their sales list. It was hosted on Github and the data was displayed a little annoyingly, so I went to see if I could clone their repo and edit it myself. Went looking through their Javascript and ho-ly ****, it was something like:

Code:
function makeTableAToZ() {
  for (var i = 0; i < array1.length; i++) {
    // output html
  }
  for (var i = 0; i < array2.length; i++) {
    // output html
  }
  // repeat for 4 more arrays
}

function makeTableZToA() {
  for (var i = array1.length - 1; i >= 0; i--) {
    // output html in exactly the same manner as the previous function
  }
  // repeat 5 more times in exactly the same manner as the previous function
}
If anyone is ever feeling bad about a job search or something, just go read this post again and remind yourself that somewhere, an employed programmer wrote this.
Dumb question but I'm not grasping the issue here. Maybe I'm not envisioning the code right. Also, I've never used javascript.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-25-2016 , 02:27 PM
I assume that
// output html
is the same in all the places you see it, i.e. all that formatting and text copied in 9 places. It should be a function that takes an array and outputs the html, and then you could iterate over a list of arrays and output them. Code is probably 10% the size, executes just as fast, and is going to be way easier to understand and maintain.

My favorite side effect of code like this is when one or 2 of the duplicate sections is different. Was that on purpose? Was it an accident? Should you "fix" it or duplicate the difference when you refactor it? Duplicate code leaves you a place for mistakes and ambiguity.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-25-2016 , 03:13 PM
Quote:
Originally Posted by Biggle10
Dumb question but I'm not grasping the issue here. Maybe I'm not envisioning the code right. Also, I've never used javascript.
Yeah, like Rusty said it's repeating itself everywhere and desperately needs to be split into functions. I probably should have added originally that the "// output html" code in the original snippet was exactly the same for every item in every array, like, stuff from one array didn't need to be output differently than stuff in another array. So, there were 2 levels of duplication ****ups:
- the AtoZ function and ZtoA function were duplicating everything (the HTML output, the list of arrays to iterate over) and changing only whether the for loops went from size-1...0 or 0...size-1
- each for loop was duplicating the HTML output and changing only the array that was being iterated over

I'm not a JS expert but I refactored it into this to do some work on it locally and add some functionality:

Code:
var allArrays = [array1, array2, ...];

function renderItem(item) {
    // output html
}

function makeTable(reverse) {
    allArrays.map(function (array) {
        return reverse ? array.slice().reverse() : array;
    }).forEach(function (array) {
        array.forEach(renderItem);
    });
}

function makeTableAToZ() {
    makeTable(false);
}

function makeTableZToA() {
    makeTable(true);
}
** 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