• Breaking News

    Monday, April 22, 2019

    Facebook makes its first browser (chrome) API contribution - Facebook’s engineers created the isInputPending API, allows developers to check whether there are any inputs pending while their code is executing web developers

    Facebook makes its first browser (chrome) API contribution - Facebook’s engineers created the isInputPending API, allows developers to check whether there are any inputs pending while their code is executing web developers


    Facebook makes its first browser (chrome) API contribution - Facebook’s engineers created the isInputPending API, allows developers to check whether there are any inputs pending while their code is executing

    Posted: 22 Apr 2019 12:40 PM PDT

    Why we could use a JSON "audio" format for the Web

    Posted: 22 Apr 2019 03:28 AM PDT

    I made a music app in HTML5, and it uses its own format, called OMG. The big question I get is:

    Why didn't I use MIDI or MusicXML?

    The simple answer is that they don't meet my requirements.

    1. MIDI and MusicXML store specific notes, while OMG only stores the general idea of a melody

    The specific notes that OMG will play are calculated at run-time based on an OMG note and the song's parameters. Specific notes aren't stored in the data.

    Just as you wouldn't store the user's timezone and locale formatting options when storing a datetime in a database, only the most generic information gets stored about an OMG note. More on this below.

    2. MIDI and MusicXML don't store URLs to sounds across the Internet

    In my app, any URL to an audio file can be used to make sounds. URLs to the sounds need to be stored in the data file.

    3. MIDI and MusicXML are more linear than OMG

    Music in MIDI and MusicXML takes more of the traditional approach of songs having a beginning, middle, and an end. OMG allows you store arrangements in the file format, but it isn't required.

    4. JSON is more modern and usable on the web than binary or XML

    If MIDI and MusicXML can't store the type of data my app needs, then I need a new format, and it might as well be JSON.


    If OMG doesn't store specific notes, what does it store?

    The melody to "Mary Had A Little Lamb" starts out E, D, C, D, E, E, E.

    Most music software stores these notes as MIDI notes, in which case the melody would be 64,62,60,62,64,64,64.

    OMG stores notes differently. The OMG version of this melody is 2,1,0,1,2,2,2. To play this melody, the OMG notes are translated to MIDI notes based on some parameters:

    • rootnote
    • scale
    • octave

    If the key of our song is C Major and middle C is note 60, here's the parameters we need:

    • rootnote = 0
    • scale = [0,2,4,5,7,9,11]
    • octave = 5

    The rootnote can be 0 to 11, where C = 0, C# = 1, D = 2 up to B = 11, just like the MIDI notes.

    The scale is a list of MIDI notes in the scale. Here the scale is 0, 2, 4, 5, 7, 9, 11, which is C, D, E, F, G, A, and B.

    And the octave puts the melody in the middle of the instrument.

    Here's a basic formula to calculate the MIDI note from the OMG note;

    midinote = scale[omgnote] + rootnote + octave * 12 

    Example 1. C Major

    Here is the melody in OMG notes again: 2,1,0,1,2,2,2. The first omgnote is 2. Plug that and the other parameters in:

    midinote = scale[2] + 0 + 5 * 12 midinote = 4 + 0 + 5 * 12 midinote = 64 

    When omgnote = 2, then midinote = 64. The second omgnote in the melody is 1, so:

    midinote = scale[1] + 0 + 5 * 12 midinote = 2 + 0 + 5 * 12 midinote = 62 

    And the third note in the melody is omgnote = 0.

    midinote = scale[0] + 0 + 5 * 12 midinote = 0 + 0 + 5 * 12 midinote = 60 

    So we've converted 2,1,0 in OMG notes to 64,62,60 in MIDI notes.

    Example 2: C Minor

    To turn a Major scale into a Minor scale, you lower the 3rd, 6th, and 7th notes of the scale. Here's Major and Minor compared:

    major = [0,2,4,5,7,9,11] minor = [0,2,3,5,7,8,10] 

    The first note in the melody is 2, so using the minor scale:

    midinote = scale[2] + 0 + 5 * 12 midinote = 3 + 0 + 5 * 12 midinote = 63 

    Now the melody begins with 63, which is an Eb, instead of 64 which is an E like it was in C Major.

    Example 3: F Minor on bass

    Let's change the parameters so the melody is more in the range of a bass guitar, and change the key to F Minor:

    • rootnote = 5
    • scale = [0,2,3,5,7,8,10]
    • octave = 3

    Just like the last example, we'll be using the Minor scale. This time we're changing the rootnote to 5 (MIDI note for F) and octave to 3, the middle of bass instrument.

    midinote = scale[omgnote] + rootnote + octave * 12 midinote = scale[2] + 5 + 3 * 12 midinote = 3 + 5 + 36 midinote = 44 

    And if you do all the notes, you get melody of MIDI notes that is 44,43,41,43,44,44,44, which is Mary Had A Little Lamb in F Minor on the bass.

    In all these examples, the melody in OMG notes is 2,1,0,1,2,2,2, even though in each example the MIDI notes played are different.

    Chords

    The formula to calculate the MIDI note from an OMG note can also make chord progressions.

    Let's play Mary Had A Little Lamb over a I, IV, V progression, aka 1,4,5. Remember that computers start counting at zero, so instead of 1,4,5 our chord progression parameter is 0,3,4:

    • chords = [0,3,4]
    • rootnote = 0
    • scale = [0,2,4,5,7,9,11]
    • octave = 5

    And we change the formula to simply add the chord to the omgnote, and find the right note in the scale:

    midinote = scale[omgnote + chord] + rootnote + octave * 12 

    Because there are three chords in the chord progression (0,3,4), the melody will be translated from OMG notes to MIDI notes three times as loop over the chords array. The first time will be chord = 0 (the I) and so the output will be the exact same as before: 64,62,60,62,64,64,64.

    Next comes the same melody moved to the next chord in the progression, which is 3. The first note of the melody is 2, so omgnote = 2 like usual, but we add 3 for the chord:

    midinote = scale[omgnote + chord] + rootnote + octave * 12 midinote = scale[2 + 3] + 0 + 5 * 12 midinote = 9 + 0 + 60 midinote = 69 

    The original melody of OMG notes (2,1,0,1,2,2,2) after apply all three chords is:

    64,62,60,62,64,64,64, 69,67,65,67,69,69,69, 71,69,67,69,71,71,71 

    Or:

    E D C D E E E A G F G A A A B A G A B B B 

    Portability

    Change the chords, and key, and scales, and the octaves all you'd like, but you're never actually changing the OMG melody. It has been 2,1,0,1,2,2,2 since the beginning. Having this motif around makes it easy to compose, and easy to mix into other works.

    A person listening to something on OMG may say "I really like that bassline", and "I really like that hook in this other song". With OMG, the parts can be combined without modifying the OMG notes at all.

    That's because the rootnote and the scale and the chord are applied at run-time to the underlying omgnote that is stored. The OMG data defines the general idea of the melody, and the song's parameters give it the actual notes.

    In Open Music Gallery, being able to mix and match different parts of songs is important, and using OMG notes instead of MIDI notes simplifies that.


    Thanks for reading

    I hope that explains why I'm using a new file format instead of one that's more common. The common ones just can't store the type of data used by my app. The specific notes get generated at run-time. That's to make the parts of music made by the platform immediately interchangeable.

    Here's the source:

    The editor:

    The gallery:

    Dev Guide for making programmable music for games in JavaScript

    General introduction:

    EDIT

    The list of notes in the melody is just for illustration. It's actually an array of objects, and here's a full example of the data:

    http://openmusic.gallery/data/1480

    Here's what it is:

    http://openmusic.gallery/play/1480

    submitted by /u/mobydikc
    [link] [comments]

    Microsoft's PWA Builder hits version 2.0 with new design and more

    Posted: 22 Apr 2019 12:41 PM PDT

    10 HTML Elements You Didn't Know You Needed

    Posted: 21 Apr 2019 07:21 PM PDT

    A Brief History of Web Development: Part Zero. I'm starting to write more, and would love some feedback!

    Posted: 22 Apr 2019 09:08 AM PDT

    I'm bad at code challenges, but give me an app idea/specs and I can make them confidently. This is giving me intense impostor's. Who else feels this way? I am afraid to apply because of this

    Posted: 22 Apr 2019 03:10 AM PDT

    I've been a developer for two years and at this point I can create any full stack products from scratch. But give me a code challenge that you typically see on codewars, hackerrank, or any technical assessment and I feel super useless.

    Is there something wrong with me? Or is this a normal thing?

    This will be my first time on actual job hunting (I was an intern who got hired so I have no prior job hunting experience) and I'm doing bad at code challenges so far, this is giving me bad bad inferiority complex and now I am somehow afraid to apply for jobs.

    :(

    submitted by /u/AbanaClara
    [link] [comments]

    Where can I check a website for non-working pages?

    Posted: 22 Apr 2019 04:58 AM PDT

    Webcam in a Favicon

    Posted: 21 Apr 2019 07:48 PM PDT

    How complex should/do the portfolio projects be to get your first job as a junior level developer?

    Posted: 22 Apr 2019 03:21 PM PDT

    I'm working on creating projects and learning how to work with JavaScript along with HTML and CSS and I am wondering how complex/unique the projects have to be. For one, I have created a simple Giphy searcher using their API. I also have created a simple to do list app that lets the user add, remove, mark as complete, and show completed tasks. However, it doesn't store the tasks anywhere so they disappear when the page is refreshed.

    Are these projects too simple and should I use the skills I learned from developing them to create a more complicated project or would they be good enough to put on a portfolio site and at least start applying for jobs.

    Any and all advice is appreciated. Thanks in advanced.

    submitted by /u/thelearninglemur
    [link] [comments]

    How much should I charge for this type of website?

    Posted: 22 Apr 2019 12:52 PM PDT

    I don't have any professional experience in web development, as I have only built websites for fun in the past. However, I have been approached by an acquaintance who needs a portfolio website. The website should have the landing page and an additional one for the showcase of his work. Other than that, he is pretty much open to anything. We did discuss color schemes and such details, and I already have a design in mind. Since I'm a beginner, I really have no idea how much to charge for this.

    If it helps, I'm from a small developing country and that's part of why I really have no clue about the range of website pricing. Any advice would be greatly appreciated!

    submitted by /u/missusunce
    [link] [comments]

    Netlfiy website is not showing up in search results

    Posted: 22 Apr 2019 09:54 AM PDT

    After hosting my portfolio website built with Gatsby on Netlify, I connected my domain that I got from google domains to Netlfiy using a CNAME record and setting Netlify as my DNS. After a few days I was suspicious as to why I couldn't find the website when I searched for firstname lastname on google. So I set up a google webmasters account and verified my website. Until now it is still showing 'loading website data'. Even weirder, if I inspect the url, it shows me that the page is not indexed, but was found and crawled without errors. This might be normal behavior for urls like www.firstname-lastname.com, because only firstname-lastname.com gets indexed? The name is pretty rare and all the search entries are related to me, but are things like my Highschool track team or LinkedIn.

    What can I do to improve my search ranking? It seems unreasonably low. If I search for site:www.firstname-lastname.com it does show up, making me think it might be indexed.

    Sorry if this is a bit confusing, but I am confused. It's not the first time for me dealing with SEO and google tools, so I'm a bit dazzled as to why this is not working. Any ideas are welcome

    submitted by /u/bbrinx
    [link] [comments]

    Media queries for phones not working?

    Posted: 22 Apr 2019 01:20 PM PDT

    I have the following code for iPhone 8 (my current phone I am checking on) and it doesn't seem to work:

    /* iPhone 8 */ @media only screen and (max-width : 375px) and (max-height : 667px) and (orientation : landscape) and (-webkit-device-pixel-ratio : 2) { .logo { width: 20%; height: 20%; } } 
    submitted by /u/Wizard_Knife_Fight
    [link] [comments]

    Image Naming Conventions

    Posted: 22 Apr 2019 03:44 PM PDT

    We are migrating our website to a new platform and in doing so I was tasked to come up with a standard naming convention for all imagery on the website. Below are some thoughts and questions about best practices and I am looking for some opinions or validation in the form of published articles. Any help is appreciated.

    - I read that googles seo prefers hyphen over dashes.

    - The same article said I should not abbreviate but this will lead to really long filenames.

    - Our dev requests that we include the full dimensions fo the images. We want to argue that just the width is sufficient as sometimes the height of and image can vary even though it is part of the same component. Sometimes we change the height of a file and this will allow us to overwrite without having to first rename an uploaded file.

    - I've seen a couple of things that say to use all lowercase but is there reasoning for this?

    - We want it to be clear what type of image it is and if possible its location included in the name.

    Right now this is what I am thinking for a sample:

    pagetype-imagetype-description-width.jpg

    Here are a couple of examples to further explain:

    about-thumbnail-article-name-400.jpg

    support-banner-contact-us-700.jpg

    product-fullwidth-background-1600.jpg

    We also have images that appear in multiple locations so my thinking is to have one folder in the root of the section which will allow me to remove the page type from that names

    video-thumbnail-product-name-400.jpg

    Lastly, we often have variations for different countries which requires us to include a country code. This is why I want to include Capital letters.

    product-fullwidth-background-1600-US.jpg

    submitted by /u/robc0nti
    [link] [comments]

    SSH/GPG keys across dev machines

    Posted: 22 Apr 2019 03:40 PM PDT

    I'm giving full-time Linux a serious go this week. I've got a distro I like installed on a spare laptop and everything I need setup. Keeping my Macbook as a backup. Should I copy over the SSH key and GPG keys from my Macbook? My github and my DO servers are all tied to those or should I generate a new set?

    submitted by /u/PristineTransition
    [link] [comments]

    How do I get my buttons to stay where they are?

    Posted: 22 Apr 2019 03:26 PM PDT

    Okay guys, I am a web developer trying to create a pretty custom job and am wondering how to get this project done.

    The Website

    The main problem I am having is if I should be sticking with WordPress to get this done, or should I be using a Code Editor like DW? The buttons that I am trying to create in Elementor are not staying in the exact place that I put them, and I dont really know what to google to find out more about what I need to know to finish this.

    I am really trying to develop my skills as a developer, but when do you just get to the point where you tell the client that you can't do what he is asking...

    submitted by /u/Magicmatt352
    [link] [comments]

    Trying to find code for a portfolio filter gallery without jquery or boostrap

    Posted: 22 Apr 2019 03:25 PM PDT

    I don't know much JS/CSS, sorry if this is an absurd question.

    Do you have some examples or tutorial to make a portfolio filter gallery like this one ( https://codepen.io/pramodkumarboda/pen/XdgxmQ ) but without boostrap or jquery?

    My idea is to use grid and plain javascript. Is that even possible?

    submitted by /u/ashagnes
    [link] [comments]

    HELP: Add new Zendesk chat tags to visitor's repeating actions on website's "Book Now' widget

    Posted: 22 Apr 2019 03:21 PM PDT

    On my escape room site (clueavenue.com) there's a Booking provider's "Book Now" widget. I also have a Zendesk customer service "chat" widget on my site. Currently, when a customer clicks on the "Book Now" widget, my Zendesk chat account "tags" the customer as "Clicked-Booked-Now". I accomplished that with this code...

    ~~~~ <script> (function($){ $(function(){ $('body').on('click', 'a[peek-initialized="true"]', function(){ $zopim(function(){ $zopim.livechat.addTags("Clicked-Booked-Now"); }); }); }); })(jQuery); </script> ~~~~

    I'm a newbie to all this, so my question is how do I change/add-to the code to make it so that each ADDITIONAL click of the "Book Now" button will (1) remove the previous "Clicked-Booked-Now" tag, and (2) add "Clicked-Booked-Now-2", "Clicked-Booked-Now-3", etc etc??

    I basically want the ability to look at the tag and see how many times the customer clicked the "Book Now" widget during their website visit. FYI: here's a link to the Zendesk page describing how to REMOVE tags...

    https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#removeTags

    submitted by /u/timetofreak
    [link] [comments]

    Firefox and Chrome (devtools)

    Posted: 22 Apr 2019 03:05 PM PDT

    Hi all, I'm getting increasingly curious about Mozilla and their movement of using Rust/Web Assembly to gain predictable performance. Beside that, I'm now curious about how Firefox would be as a devtool for debugging etc. For anyone using Firefox, is there anything you prefer there than using Chrome?

    submitted by /u/what_is_life___
    [link] [comments]

    Markdown or Rich Text Editor?

    Posted: 22 Apr 2019 01:43 PM PDT

    Short Question: Do you prefer writing in Markdown or Rich Text Editor?

    Long Question: Different websites have their own ways for writing. Two main way of those are markdown and rich text editor. Some sites like hashnode and many forums uses markdown. Some websites like medium use rich text editors. Reddit has both (even there's some errors in switching between.). So, what do you think better to use? And, what's easy for you?

    Thanks.

    submitted by /u/SupunKavinda
    [link] [comments]

    PSA: SparkPost cancelled my account unexpectedly and will not reactivate and will not accept any blame.

    Posted: 22 Apr 2019 01:07 PM PDT

    Just trying to give the community a heads up on the recent practices of SparkPost.

    I use SparkPost to send transactional email, e.g., welcome emails, etc. A month ago one of my sites got hit by some spam signups which meant the fake emails that the spammers used were getting welcome emails sent to them which were bouncing. After nearly a week of this, SparkPost suspended my account because of the high bounce rate. Fair enough, that's one me. I didn't get it fixed fast enough and ended up receiving 393 bounced emails (which even that in the grand scheme of things isn't a lot).

    I ended up implementing ReCaptcha on my signup form as well as straight up blocking the main domain in question from all the spam. These measures were enough to get my account re-activated.

    From that point on (this was a month ago), My account has been auto-suspended every few days or so. Each time that I've been suspended, I email them to ask why and received this canned response back:

    To help make sure the SparkPost service is not misused, we employ automated detection systems that can suspend accounts based on certain activity and metrics that suggest inappropriate use. Our diligence making sure our service remains free of inappropriate activity and spam helps ensure the great performance our customers have come to expect. Most of the time, we find that these systems have worked properly and prevented bad mail from going out. Rarely, these tools may also find a "false positive." It appears this happened to your account today. Upon manual review, we have reactivated your account. 

    This happened ten times in the last month (each time being re-activated because it was suspended as a result of a false-positive from their automated system) and the last time (last week) they send me this (keep in mind that I have no had a since bounced email since the initial wave of spam):

    Thank you for your interest in SparkPost. We strive to offer the very best email service, and to that end, we maintain a strict anti-abuse messaging policy. Because we cannot offer you the high deliverability you would expect from SparkPost, we must decline to provide our services. We wish you the best in your future business endeavors. 

    I reply to them and get no response. I then reach out on Twitter and am asked to send over my Account ID in a DM so they can look into it. They respond after a few days with:

    I've heard back from the appropriate team and at this time, the best course of action for you is to continue working with our support team via email. You can always feel free to reach out to them at compliance@sparkpost.com with any questions. Thanks again for your patience and have a wonderful week! 

    So I again email the compliance team over at SparkPost and receive this response 10 minutes later:

    Thank you for your interest in SparkPost. We strive to offer the very best email service, and to that end, we maintain a strict anti-abuse messaging policy. Because we cannot offer you the high deliverability you would expect from SparkPost, we must decline to provide our services. We wish you the best in your future business endeavors. 

    To me, this seems like nothing more than a way to boot people off of their grandfathered free tier plans which have since went away (cheapest now looks like $49 a month). The fact that I'm not able to get a response aside from some sort of canned message seems extremely shitty to me considering that I fixed the issue and am being banned because their automated system sucks.

    Still, since the initial wave of spam, I've yet to receive another bounced email and now I've been completely banned and locked out of my account and I guess am forced to sign up for another service. Sucks considering the time and years I had invested in SparkPost, but I wasn't making them any money, so I can see the motivation for getting folks like me out of there although my usage was very low. The sites I use with SparkPost don't receive a lot of traffic.

    Sorry this got long, but I wanted to just give everyone a heads up as to the practices at SparkPost. If you're looking for a service for email relay, I'd look elsewhere.

    ------------------------------------------------------------------------------------------------

    Update: Just received this response from their compliance team:

    Thanks for your response. Your sending practices are not compatible with our policies. It is not because you are a free account, if we see these kind of issues with our high volume customers, we do the same thing. Regards, Compliance team 

    So far they've not told me what sending practice isn't compatible with their policies and why (if I was in violation of some policy) was I ever re-activated to begin with the initial time that I was suspended.

    submitted by /u/dustinsjohnson
    [link] [comments]

    Why I Switched From Visual Studio Code to JetBrains WebStorm

    Posted: 22 Apr 2019 05:15 AM PDT

    Which library to start with?

    Posted: 22 Apr 2019 12:35 PM PDT

    I'm starting a new project. I want to use react and firebase. They both have roughly the same scaffold steps. Command line "generate project" and off you go.

    Is there any recommendation on which one to start with? Is it easier to add firebase to react or react to firebase or should I be using something completely different I haven't heard of?

    submitted by /u/JakeTheDork
    [link] [comments]

    React-Ikonate a new React package based on Ikonate

    Posted: 22 Apr 2019 12:13 PM PDT

    So I saw the post 3 days ago by u/erenhatirnaz promoting Ikonate. I really liked the icons so I thought I'd share with you my version of bundling them together with TypeScript and React Context support for easy styling and usage in React applications, without the need to add a special Webpack loader.

    You can find it on GitHub and on NPM.

    I really hope you'll appreciate it and thank you for those who made Ikonate and therefore this project possible.

    submitted by /u/danielkov
    [link] [comments]

    No comments:

    Post a Comment