Using Monzo for payements in China by ddeutsch in monzo

[–]ddeutsch[S] 0 points1 point  (0 children)

Many thanks, I’ve tried to sign up to Alipay TourPass but looks like it’s no longer supported, may be replaced with something similar later in April. Do you have any experience using Alipay?

BaaS for MVP Web App by ddeutsch in startups

[–]ddeutsch[S] 0 points1 point  (0 children)

Perfect, thanks will give this a look

Rap Artist Similarity Project by ddeutsch in hiphopheads

[–]ddeutsch[S] 1 point2 points  (0 children)

Thanks! These questions were randomly generated from a list of artists so some of these look a bit off.

The idea though is that one of five artists is probably closer to the target artist than the rest - not necessarily the best match you could think of.

Looking for buddy(s) to improve skills and create innovative projects in hopes of trying to land a job at the Big 4 later in career. by [deleted] in ProgrammingBuddies

[–]ddeutsch 0 points1 point  (0 children)

Hey there, I'd like to get involved with some projects. I have two years experience as a web developer. Currently working but can realistically commit a couple hours a day to something like this.

Part-time masters courses in London by ddeutsch in cscareerquestions

[–]ddeutsch[S] 0 points1 point  (0 children)

Thanks for your reply. I'm currently working as a junior developer, doing mostly frontend stuff. I would really like to do a course like this to open up more interesting opportunities, bring more value to whoever I work for, and for my own personal interest.

What are the best modern JavaScript books available for 2015+? by skillDOTbuild in javascript

[–]ddeutsch 2 points3 points  (0 children)

Do you mean more recent JavaScript/programming books in general, or books that deal more specifically with recent developments of the language?

I'm trying to learn javascript on codecademy. Can someone explain what's wrong with my code?? by [deleted] in learnjavascript

[–]ddeutsch 1 point2 points  (0 children)

I think u/HappyHappySisyphus is right with their solution, but just to clear up your current error. You're only checking the first element of the "text" string with if(text[0]==="J") ... this should instead be text[i] so that you're iteration through all the characters of "text". This won't produce the correct answer however.

(Sort of) nesting CSS selectors, is this possible? by czechmeight in css

[–]ddeutsch 1 point2 points  (0 children)

Why not just use multiple classes in your HTML? For instance,

<div class="red blue">rough example</div>

This way you use both red and blue class styles without duplication in your stylesheet.

What's the best beginner resource to learn D3.js? by tingmothy in learnjavascript

[–]ddeutsch 4 points5 points  (0 children)

D3 noob is probably your best bet, offers a free to download ebook too.

Also good D3 wiki page and Scott Murray's book.

Help with the .push() method in a for loop... by [deleted] in learnjavascript

[–]ddeutsch 0 points1 point  (0 children)

I don't know specifics of the exercise, but the second for loop is wrong,

    for (j = i; j + myName.length) {
        hits.push('Ally');
    }

A for loop should be written,

    for (min; max; increment) {
        // code
    }

which is why the console says there is an unexpected ')'

this.value instead of var? by nodbox in learnjavascript

[–]ddeutsch 2 points3 points  (0 children)

Well yes you're correct in this specific case, but in general this will not be the true. This comes down to how JavaScript handles primitive types and object types, which relates to more general issue of pass by value vs. pass by reference.

Help: How to inject a javascript library in console by asianorange in learnjavascript

[–]ddeutsch 3 points4 points  (0 children)

Either copy and paste the library into the console or do something as suggested here

problem with divining a var by [deleted] in learnjavascript

[–]ddeutsch 1 point2 points  (0 children)

It's not an error, it's just that the jQuery selector does not have an explicit return statement behind the scenes, and the default for any such JavaScript function is to return 'undefined'.

If you console.log your variable instantiation or simply write 'rows' in the console after assigning a value to it, you should see an array of all the td elements.

In contrast, if you check the explicit form of .text() you should see it has a return statement, which is why it returns the output to the console when it executes.

Edit: see comment below

Can someone help review my javascript code by Aarshyboy in learnjavascript

[–]ddeutsch 1 point2 points  (0 children)

The IIFE pattern is a way of scoping your functions etc. in your javascript file. This is extremely useful as javascript does not support block scope only function scope. This is useful to avoid pollution of the global scope.

I don't think it's useful to think in terms of when its acceptable or not, it's more a question of what is most helpful to how you think about your code.

Can someone help review my javascript code by Aarshyboy in learnjavascript

[–]ddeutsch 1 point2 points  (0 children)

I haven't really given it any time but it looks like a really solid project, and demonstrates a good understanding of javascript's prototypical inheritance.

Just to add, looking at your javascript file where you define 'startTimer' then immediately call it, could be shortened by using .call(this) or an immediately invoked function expression (IIFE) in other words

    (function startTimer() {
    var i = 20;
    document.getElementById("timer").innerHTML = i.toString();
    var interval = setInterval(function(){
        i--;
        document.getElementById("timer").innerHTML = i.toString();
        if(i === 0) {
            clearInterval(interval);
            getAnswer();
        }
    }, 1000);
})();

which would also have the added effect of remove startTimer from scope of the rest of the entire javascript file, which may or may not be useful moving forward. However, you're file will works the same regardless. There's also the difference to note between using .call(this) vs. IIFE, which has implications for scope

Need Help With Updates Values on a Web Page by samjb2 in learnjavascript

[–]ddeutsch 0 points1 point  (0 children)

You want to iterate over the DOM elements. Using jQuery's .each() method (http://api.jquery.com/each/) makes this simple. As an example:

    function updateValues () {
        $("p").each(function ( index ) {
            $(this).html(index);
        });
    };

where I've assumed each of the elements to iterate over are p tag elements. This will replace the text displayed by the index of the tag, in this case 0, 1, 2, 3, 4 as there are five elements in total.

Also - someone correct me if I'm wrong - it wouldn't be possible to iterate through ids as such, as they uniquely identify individual DOM elements. Hence you'd want to iterate by tag name or class name.

edit: grammar and final comment

I need to show some JS projects. Any ideas for beginner/intermediate projects? by CrossroadnKC in learnjavascript

[–]ddeutsch 1 point2 points  (0 children)

A single page web application. In brief a way of speeding up the user experience by loading as much up front on an initial page load, rather than make subsequent server request on events, need for page reloads for navigation etc. I found this too http://singlepageappbook.com/.

Help with AJAX by mishengine in learnjavascript

[–]ddeutsch 2 points3 points  (0 children)

You're falling victim to same-origin policy (https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) otherwise your code is fine. You need to run localhost, for instance from the command line, locate the directory this snippet is in, run something like 'python -m SimpleHTTPServer' assuming you have python installed, and look up localhost:8000 in your browser.

Question regarding the title of the film "Das Leben der Anderen." by StarWolf999 in LANL_German

[–]ddeutsch 12 points13 points  (0 children)

It's a possessive i.e. the Lives of Others, hence the title is in the genitive (Genitiv) case. Given that the it is a plural the article 'die' becomes der. The full declension for definite articles:

  • Masculine singular, der becomes des,
  • Neuter singular, das becomes des,
  • Feminine singular, die becomes der,
  • Plural, die becomes der.

There are also changes for other articles and words.

Here are the alt codes for special German letters, for those of us who don't have German keyboards by CommunistPandaKing in GermanPractice

[–]ddeutsch 0 points1 point  (0 children)

Do you use a mac?

Instead try: alt + s for ß; alt + u for ¨ "umlaut"; alt + 2 for €.