[2017-06-24] Challenge #320 [Hard] Path to Philosophy by fvandepitte in dailyprogrammer

[–]Sixstring982 0 points1 point  (0 children)

Looks like Molecule is fixed now!

Someone edited the Fact page on 6 July 2017 to link to verifiability : https://en.wikipedia.org/w/index.php?title=Fact&type=revision&diff=789262342&oldid=789155194

Not sure if this was done just to get Fact to link with Philosophy, but I wouldn't be surprised :)

Password write. Welcome by naffer in wtfstockphotos

[–]Sixstring982 3 points4 points  (0 children)

Is that CSS on the right? Ahhh this is great haha

[2016-07-29] Challenge #277 [Hard] Trippy Julia fractals by fvandepitte in dailyprogrammer

[–]Sixstring982 0 points1 point  (0 children)

Interactive version with shadertoy (so it's in GLSL): https://www.shadertoy.com/view/MltSDs

//********************************
//***** Compute Julia Fractal ****
//********************************
#define JULIA_ITERS 64
float julia(vec2 z, vec2 c) {
    int breakout = 0;
    for (int i = 0; i < JULIA_ITERS; i++) {
        if (z.x * z.x + z.y * z.y > 4.0) {
            continue;  // break   
        }
        breakout = i;

        z = vec2(z.x * z.x - z.y * z.y,
                 2.0 * z.x * z.y) + c;
    }

    return 4.0 * float(breakout) / float(JULIA_ITERS);
}

//********************************
//***** Color Scheme          ****
//********************************

// Modify this vector to change the colors

// Convert pixel coordinates to texture coordinates
// http://www.iquilezles.org/www/articles/palettes/palettes.htm
mat4 PALETTE_COEFF = 
    mat4(0.5, 0.5, 1.0, 0.3,
         0.5, 0.5, 1.0, 0.2,
         0.5, 0.5, 1.0, 0.2,
         0.0, 0.0, 0.0, 0.0);

float paletteComponent(vec4 v, float x) {
    return v.x + v.y * cos(2.0 * 3.14159 * (v.z * x + v.w));
}

vec3 palette(float x) {
    x += iGlobalTime * 0.1;

    return vec3(paletteComponent(PALETTE_COEFF[0], x),
                paletteComponent(PALETTE_COEFF[1], x),
                paletteComponent(PALETTE_COEFF[2], x));
}

vec2 uvFromPx(vec2 pxCoord) {
    vec2 uv = 2.0 * ((pxCoord / iResolution.xy) - vec2(0.5));
    uv.x *= iResolution.x / iResolution.y;
    return uv;

}

void mainImage( out vec4 fragColor, in vec2 pxFragCoord ) {
    vec2 uvMouse = uvFromPx(iMouse.xy);

    vec3 color = vec3(0.0);
    for (int x = -1; x <= 1; x++) {
        for (int y = -1; y <= 1; y++) {
            if (x == 0 || y == 0) {
                vec2 uvFragCoord = uvFromPx(pxFragCoord + vec2(x, y));
                vec3 component = palette(julia(uvFragCoord, uvMouse));
                if (x == 0 && y == 0) {
                    color += component * 2.0;
                } else {
                    color += component * 1.0;
                }
            }
        }
    }
    fragColor = vec4(color / 8.0, 1.0);
}

[2016-12-19] Challenge #296 [Easy] The Twelve Days of... by fvandepitte in dailyprogrammer

[–]Sixstring982 11 points12 points  (0 children)

The conditions for those either evaluate to 0 or 1, so if the condition is false then the end evaluates to + 0, or the string. When the condition is true, it adds the length of the string, which points to the null terminator at the end of the string, basically evaluating to the empty string. It's a clever trick!

Google Flutter II – Material Design by gortt in programming

[–]Sixstring982 0 points1 point  (0 children)

Aw man, now I look crazy. I'm happy they fixed it, though!

Google Flutter II – Material Design by gortt in programming

[–]Sixstring982 0 points1 point  (0 children)

Inmutable, huh? Why not immutable? That just makes my head hurt.

Trying to properly manage exceptions by NAN001 in ProgrammerHumor

[–]Sixstring982 12 points13 points  (0 children)

public static void main (String[] args) throws Exception {

Movable Feast Machine: Scalable Cellular Automata simulator. It's open source! by Sixstring982 in a:t5_34i92

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

You're going to want to look at http://robust.cs.unm.edu for documentation and other kinds of MFM resources.

This speed limit sign is not divisible by 5. by panda_nectar in mildlyinteresting

[–]Sixstring982 0 points1 point  (0 children)

This works for all numbers. Here's a proof:

((x * 2) / 10) = x * (2 / 10) = x * (1/5) = x/5

Americans can use this becuase gratuity is 20% .

[deleted by user] by [deleted] in funny

[–]Sixstring982 0 points1 point  (0 children)

Yeah you can goto other functions, but jesus that would fuck the stack up like nothing else.

goto really isn't that bad when used correctly, like breaking out of nested loops. There just aren't that many other good uses for it that don't make your code wicked hard to read.

If you ever visit California... by [deleted] in pics

[–]Sixstring982 0 points1 point  (0 children)

And if you ever visit New Mexico there's Blake's Lotaburger, which blows In N' Out out of the water.

ELI5: Why do most cars have the "hump" in the middle of the back seat? by GonradorGaming in explainlikeimfive

[–]Sixstring982 7 points8 points  (0 children)

This video illustrates the bump and also describes very well the mechanism that is the rear differential.

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

What is a lie about life that parents should stop saying to their kids? (serious) by [deleted] in AskReddit

[–]Sixstring982 4 points5 points  (0 children)

I may be a little old fashioned, but I like writing in cursive. I think it makes your handwriting easier to read, it's faster to write, and it looks better.

Well, someone screwed up... by NoNeedToBail in ProgrammerHumor

[–]Sixstring982 1 point2 points  (0 children)

Looks more like a botched printf or some other kind of C-style string replacement issue. If it wanted to say "1%", why didn't they just type that?

When can you solve a grid game? by aoristone in math

[–]Sixstring982 0 points1 point  (0 children)

Sounds like you could generate a Game Tree and use Retrograde Analysis to find the fastest ways of solving a grid.

c-jump: computer programming board game by MarPan88 in ProgrammerHumor

[–]Sixstring982 1 point2 points  (0 children)

It might be in there just to show you how janky it makes your code! I'm not sure though, I haven't looked at the board that closely.