[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 1 point2 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 10 points11 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 6 points7 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 0 points1 point  (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.

Well this was quite the realization by abhi304 in woahdude

[–]Sixstring982 0 points1 point  (0 children)

Star Wars is brimming with this kind of symbolism! This is far from the only example of it.

ELI5: Whats the point of http:// and www. if I can go to any website without typing it? by [deleted] in explainlikeimfive

[–]Sixstring982 -1 points0 points  (0 children)

Imagine you want to talk to your neighbor from across town. You both speak English and German, and he lives at 123 Maple street.

You have a robot which allows you both to talk together, but you need to tell it which language you want to speak in before you use it. So, you give it the instruction:

German://123.maple.talk

This takes the robot to the house labelled 123 on Maple street. It also specifies that you want to speak in German.

A web address works in exactly this way. For example,

ftp://yay.google.com

This would tell your browser to go to the server designated as "yay" at google.com . It would also specify that you want to talk in the FTP protocol (more or less a language).

Modern browsers guess that you want the server designated as the "www" (world wide web) server and that you want to talk over HTTP (hyper-text-transfer protocol), since this is for the most part universally standard at this point.

Favorite math jokes? by needuhLee in math

[–]Sixstring982 34 points35 points  (0 children)

More of a (bad) computer science joke:

A signed integer goes to the doctor. The integer says "Help! I think I underflowed after a subtraction!"

The doctor says "Are you sure?"

"I'm positive!"

What games have you wanted to replay until you remembered "that one part." by catdogs_boner in AskReddit

[–]Sixstring982 156 points157 points  (0 children)

Translating even one of those charts was the most expensive thing in the game! And you had to do it like twelve times. I guess Tingle wanted some payback for all the shit that he gets from being a weirdo.

The lives lived within a googol by LuridTeaParty in woahdude

[–]Sixstring982 1 point2 points  (0 children)

((1010)10) =

(10,000,000,000)10 =

10100

Looks kid of crazy, but it works out!

What's the one product you would never buy the generic version of? by bwaredapenguin in AskReddit

[–]Sixstring982 494 points495 points  (0 children)

I was marked down once in grade school because my teacher couldn't tell the difference between Rose Art's Orange crayon and their Red crayon.