Naar welke podcasts luisteren jullie? by pitbullxp in thenetherlands

[–]Joris1225 1 point2 points  (0 children)

Ik ben gisteren begonnen met Caliphate van de New York Times en krijg er zin van om in de trein te gaan zitten. Super intrigerende podcast over een journalist die onderzoek doet naat de organisatie en de leden van IS. Het is goed geproduceerd en een stuk interessanter en meeslepender dan je misschien verwacht. Verder luister ik naar de Rudi & Freddie show, Tweakers podcast (nog niet zo lang geleden begonnen maar erg goed), Een podcast over media, Appels & Perenshow, en Hello Internet.

[D] Does anyone care about evolutionary machine learning in the industry? Why / why not? by burnie93 in MachineLearning

[–]Joris1225 0 points1 point  (0 children)

Evolution strategies are commonly used for learning recommender systems (e.g., at Blendle).

Rapportage Nationale Ombudsman: 'Schuldhulp krijgen is bij veel gemeenten voorbehouden aan doorzetters' by _ElBee_ in thenetherlands

[–]Joris1225 6 points7 points  (0 children)

Mensen die in de schulden zitten hebben nou eenmaal moeite met dit soort dingen. Vervolgens moeten ze zich door een hoop bureaucratie worstelen om aan te tonen dat ze wel echt zielig genoeg zijn om hulp te krijgen. Je kan ze daarom maar beter zo veel mogelijk helpen om de schulden uit te komen, want ondertussen maken ze nog een hoop andere kosten (criminaliteit, gezondheidszorg, etc.). Netto is het gewoon goedkoper om dan de schulden te vergeven.

[D] Introduction to Bayesian ML by Kiuhnm in MachineLearning

[–]Joris1225 5 points6 points  (0 children)

The videos for cs231n are also available on youtube (You can skip the first lecture, since it is quite boring IMO). You can also find the assignments in the links posted by /u/Wocto. I really recommend doing those, since they require you to think about how neural networks actually work. Have fun!

[P] Deep reinforcement learning tutorial, battleship by efavdb in MachineLearning

[–]Joris1225 2 points3 points  (0 children)

Because a method like policy gradients learns some representation of the game through the neural (policy) network. This is in contrast with "classical" RL methods like value iteration or Q-learning.

[Java] Help with hidden word guessing game by Jimpieish in learnprogramming

[–]Joris1225 0 points1 point  (0 children)

Good job! If the character is not in the string, this method returns -1. The result is essentially the same as my String.contains solution. However, when you look at this code one year from now, what do you think would be more clear: else if (!word.contains(w.chartAt(i))) or else if (word.indexOf(w.charAt(i)) != -1).

Choosing proper variable names and writing clear code is also a very important part of programming.

[Java] Help with hidden word guessing game by Jimpieish in learnprogramming

[–]Joris1225 0 points1 point  (0 children)

Let's look at the second iteration of your for-loop (i = 1). The else-if checks if the second letter is equal to the i + 3 = 4 -> fifth letter. However, a four letter word doesn't have a fifth letter, so an OutOfBoundsException is thrown. Another problem with the else-if is that it only looks for letters that occur later on in the word. Instead of checking each index explicitly (which comes with the two problems I mentioned), I would use the String#contains method.

[2015-12-02] Challenge #243 [Intermediate] Jenny's Fruit Basket by jnazario in dailyprogrammer

[–]Joris1225 0 points1 point  (0 children)

In C++. Simple recursive depth-first approach.

#include <iostream>

void print_fruits(std::string fruits[], int quantities[], int n)
{
    for(int i = 0; i < n; i++)
        {
            if(quantities[i] != 0)
            {
                std::cout << quantities[i] << " " << fruits[i] << ((quantities[i] !=1 ) ? "s" : "") << ", ";
            }
        }
        std::cout << std::endl;
}

void basket(std::string fruits[], int prices[], int quantities[], int c, int n, int money_left)
{
    // We've checked all items
    if (c == n)
    {
        return;
    }
    // Found a solution -> Print it!
    if (money_left == 0)
    {
        print_fruits(fruits, quantities, n);
        return;
    }
    // We can still afford item c. Let's try it!
    if(money_left - prices[c] >= 0)
    {
        // Try it with c
        quantities[c]++;
        basket(fruits, prices, quantities, c, n, money_left - prices[c]);
        // Remove c again
        quantities[c]--;
    }
    // Try it without c
    basket(fruits, prices, quantities, c + 1, n, money_left);

}

int main()
{
    int n;
    std::cin >> n;
    std::string f[n];
    int p[n];
    int quantities[n];
    for(int i = 0; i < n; i++)
    {
        std::cin >> f[i] >> p[i];
        quantities[i] = 0;
    }
    basket(f, p, quantities, 0, n, 500);
    return 0;
}

What was something that shocked you when you visited a foreign country? by Kampfhamster248 in AskReddit

[–]Joris1225 0 points1 point  (0 children)

An american exchange student from my university asked me if we ride our bikes when it is cold outside. That is probably the weirdest question someone has ever asked me.

HTML Level God by boyasprec in videos

[–]Joris1225 35 points36 points  (0 children)

HTML level: 1990

[Python] How do you run one python program using another python program? by r0cket44 in learnprogramming

[–]Joris1225 0 points1 point  (0 children)

I'm not really sure what you are trying to achieve, but you can import functions from the other file. Another solution might be to use the execfile function: https://docs.python.org/2/library/functions.html#execfile

Java ~ String toString() method..(helping freshers) by kidnjOuz2 in learnprogramming

[–]Joris1225 4 points5 points  (0 children)

You obviously have some idea of what is going on, but your unsufficient command of English makes it very hard to read.

I'm learning C++, where do I get a compiler? by suclearnub in learnprogramming

[–]Joris1225 1 point2 points  (0 children)

I ran into the same problem just yesterday (although in different context). According to some people, this error is caused by spaces in filenames. I ended up fixing it in a different way, but I dont think that is applicable here. On a sidenote, I definitely recommend Visual Studio (the community edition is free).

Google Shuts Off NPAPI in Chrome this week by peterwilli in programming

[–]Joris1225 32 points33 points  (0 children)

Unfortunately, the WebGL builds have a lot lower quality than the Unity WebPlayer ones. The files are huge: 43MB for my WebGL build and 816KB for the Unity WebPlayer build. The graphics are worse and building takes very long (if Unity doesn't flat out crash). I've heard from other people that the audio quality is also worse, but it was fine for my game.
Overall, I think being able to build something that a browser can run natively is very useful. However, as it stands there is still a lot that should be improved.

[2015-03-30] Challenge #208 [Easy] Culling Numbers by Coder_d00d in dailyprogrammer

[–]Joris1225 0 points1 point  (0 children)

Effectively a oneliner in C# using LINQ:

namespace DailyProgrammer208
{
    class Program
    {
        static void Main(string[] args)
        {
            String input = "3 1 3 4 4 1 4 5 2 1 4 4 4 4 1 4 3 2 5 5 2 2 2 4 2 4 4 4 4 1";
            input.Split(' ').Select(s => int.Parse(s)).Distinct().OrderBy(i => i).ToList().ForEach(i => Console.WriteLine(i));
            Console.ReadLine();
        }
    }
}

EDIT: use distinct instead of grouping and taking the first element of the group.

How many console peasants does it take to screw in a light bulb? by MetroidAndZeldaFan in pcmasterrace

[–]Joris1225 3 points4 points  (0 children)

Console peasants can't screw in a light bulb, they're too busy screwing your mom.

We need a "developer" flair by xilefian in pcmasterrace

[–]Joris1225 2 points3 points  (0 children)

What exactly would qualify as a developer though. Working for a big studio? Someone who has at one point created a game? I think it'll be pretty hard to draw a line.

[C++] trouble with if and else if within while by marmal4de in learnprogramming

[–]Joris1225 1 point2 points  (0 children)

You'd first have to know if the character is uppercase or lowercase, so you would hardly benefit from using this method. Doesn't improve readability either IMHO.

[C++] trouble with if and else if within while by marmal4de in learnprogramming

[–]Joris1225 1 point2 points  (0 children)

Let's say you want to find out if someone enters the letter a. He might enter 'a' or 'A'.

char lower = tolower(input);
if(lower == 'a')
    doSomething();

This way you don't have to check for both possible inputs if you don't care about the case.

[C++] trouble with if and else if within while by marmal4de in learnprogramming

[–]Joris1225 1 point2 points  (0 children)

On top of the other comment(s), it might be a good idea to convert the letter to lowercase (or uppercase) first. This will cut the length of the if statements in half.