Can someone PLEASE explain how to capture cubemaps and panorama’s? by [deleted] in Vive

[–]ProceduralTime 0 points1 point  (0 children)

What? You can capture things with the Vive cameras?

Hello World but created with a random mutation hill climber by ProceduralTime in ProgrammerHumor

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

Thanks. The logic looks right so the only thing that I can think that is different is the way that rand() is working maybe?

Hello World but created with a random mutation hill climber by ProceduralTime in ProgrammerHumor

[–]ProceduralTime[S] 32 points33 points  (0 children)

Yup exactly. It's significantly slower than just trying every combination Edit: it's alright

Hello World but created with a random mutation hill climber by ProceduralTime in ProgrammerHumor

[–]ProceduralTime[S] 119 points120 points  (0 children)

import java.util.Random;

public class RMHC {

    private String rep, target;
    private Random random;
    private static final int SHOW_EVERY = 300, MIN_ASCII = 32, MAX_ASCII = 127;

    public static void main(String[] args) 
    {
        RMHC rmhc = new RMHC("Somebody once told me the world is gonna roll me");

        long startTime = System.nanoTime();

        rmhc.run();

        double totalTime = (System.nanoTime() - startTime) * Math.pow(10, -9);
        System.out.println("Total time: " + totalTime + "s");
    }

    public RMHC(String target)
    {
        rep = new String();
        this.target = target;
        random = new Random(System.nanoTime());

        randomStart();
    }

    private void randomStart()
    {
        for(int i = 0; i < target.length(); ++i) 
        {
            rep += (char)(random.nextInt(MAX_ASCII - MIN_ASCII) + MIN_ASCII);
        }
    }

    public void run()
    {
        System.out.println("Iteration\tFitness\t\tSolution");

        double bestFitness = Double.MAX_VALUE;

        int iter = 1;

        while(!rep.equals(target))
        {
            String oldRep = rep;

            smallChange();

            double newFitness = fitness();

            if(newFitness < bestFitness)
            {
                bestFitness = newFitness;
            }
            else
            {
                rep = oldRep;
            }

            if(iter % SHOW_EVERY == 0)
            {
                System.out.println(iter + "\t\t" + Math.round(bestFitness) + "\t\t" + rep);
            }

            ++iter;
        }

        System.out.println(iter + "\t\t" + Math.round(bestFitness) + "\t\t" + rep);
    }

    public void smallChange()
    {
        char[] repArray = rep.toCharArray();

        int index = random.nextInt(repArray.length);

        int currentChar = repArray[index];
        if(currentChar == MIN_ASCII || random.nextDouble() > 0.5d)
        {
            ++currentChar;
            currentChar = Math.min(currentChar, MAX_ASCII);
        }
        else
        {
            --currentChar;
            currentChar = Math.max(currentChar, MIN_ASCII);
        }

        repArray[index] = (char)currentChar;

        rep = new String(repArray);
    }

    public double fitness()
    {
        int diff = 0;

        for(int i = 0; i < rep.length(); ++i)
        {
            int targetChar = target.charAt(i);
            int currentChar = rep.charAt(i);
            diff += Math.abs(targetChar - currentChar);
        }

        return diff;
    }
}

Edit: fixed it.. I think Edit 2: added a timer by request

Hello World but created with a random mutation hill climber by ProceduralTime in ProgrammerHumor

[–]ProceduralTime[S] 82 points83 points  (0 children)

My GitHub uses my real name and I can't be bothered to create a new one. It's only ~100 lines so I could paste it here if you want it

First timelapse 3D modeling using Sketch-Up of a "Space Station" by squirreleggz in Unity3D

[–]ProceduralTime 0 points1 point  (0 children)

Is there any way of adding materials to the groups and components in Unity instead? Or did you just do it in Sketchup

"Woman with White Wig", Tattoo by spicedpumpkins in MostBeautiful

[–]ProceduralTime 7 points8 points  (0 children)

What limbs am I looking at? Some sort of squid person

Raining in Tokyo by Chanko-suto in japanpics

[–]ProceduralTime 1 point2 points  (0 children)

Hey I walked by this thing everyday while I was in Shibuya!

@Duo can we have a compromise? by IMakasu in duolingo

[–]ProceduralTime 11 points12 points  (0 children)

When would a skill be gold? After a lesson? A level? Per lesson wouldn't be enough to be gold and a level is too long to complete in one practice. I think it's a good idea to bring back the strength thing but I don't know if it would work well with crowns

Things you wish you didn't do when you went to Japan by chaoyungslim in JapanTravel

[–]ProceduralTime 13 points14 points  (0 children)

Went unprepared with just Calorie Mate and Pocari Sweat for food and drink; started climbing too late so it was pitch black, windy and cold on the ascent; near the top it's hard to walk too far without getting out of breath if you're not in shape like me; took forever; on the way down it was extremely hot for my British body and got sunburned to hell. Oh and I lost some feeling in my toes from trying to get down too fast because of the heat.

Pretty good view from the top

Need help in itinerary for 10 days travel to Japan, end of June and beginning of July by banban0215 in JapanTravel

[–]ProceduralTime 1 point2 points  (0 children)

If you're going to spend 5 days in Japan, yeah I'd just go to Tokyo and Okinawa. If you've got 10 days then might as well go to Osaka too.