Offtopic Topic 74 - OS2016 & Back to School editie

Gestart doorLuuko2.505 reacties16.470 weergaven

2.506 berichten · pagina 127 van 168

Berichten
7.307
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Stef schreef:
Eerdere citaten tonen
Jordyt schreef:
Eerdere citaten tonen
Stef schreef:
Wat betekent het als je bent "uitgeschreven uit het handelsregister"?
Ik heb hier afgelopen woensdag iets gekocht en nooit iets van gehoord.

https://www.webwinkelkeur.nl/leden/Deboled_762.html#rating
Denk dat je het ook wel kunt vergeten ;(
Ik denk dat ik aangifte moet gaan doen, inderdaad sadley
toevoeging op zondag 13 november 2016, 20:00:02:
Overigens vind ik het jammer dat deze dingen nogsteeds mogelijk zijn in Nederland.
Erger vind ik dat er weinig tegen gedaan wordt. Jij doet nu aangifte en er wordt niet meteen actie ondernomen, pas na 2/3 aangiftes komt er een melding bij mijnpolitie.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Heb ooit eens een DVS gekocht bij een goedkope dozenschuiver webshop. De levertijd was 2 dagen.

Werd na 1 maand geleverd shutup. Heb in de tussentijd toen elke dag de eigenaar gebeld op huis en mobiele telefoon. Soms kreeg ik een voicemail na lang wachten, soms was de telefoon uit en kreeg ik direct een voicemail.
Na een week of drie kreeg ik een excuus dat de eigenaar in het ziekenhuis zou liggen en de spullen alsnog na zijn opname snel ging versturen. Het klinkt als een bullshit-verhaal naar mijn idee.....

Maar de DVD kreeg ik uiteindelijk wel binnen.
0
Ben

Lid

Berichten
4.598
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Weet iemand nog een goeie plek om sites/domeinen kwijt te geraken?
0
Luuko

Lid · Topicstarter

Berichten
7.498
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Binnenkort maar eens kaarten kopen voor zwarte cross pompom
0
Berichten
16.500
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Wtf, er lag sneeuw op straat redfaceredface
0
Berichten
15.958
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Morgen eerste stage dag redface
0
Stef

Lid

Berichten
10.150
Reputatie
2
Punten
0,00
Lid sinds
Laatst gezien
Heel vieze javascript geschreven omdat het toch maar een klein bestandje zou worden. Is uiteindelijk veel groter geworden dan verwacht...
OH GAWD WHAT HAVE I DONE cry cry cry cry cry cry
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Stef schreef:
Heel vieze javascript geschreven omdat het toch maar een klein bestandje zou worden. Is uiteindelijk veel groter geworden dan verwacht...
OH GAWD WHAT HAVE I DONE cry cry cry cry cry cry
bah
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Stef schreef:
Heel vieze javascript geschreven omdat het toch maar een klein bestandje zou worden. Is uiteindelijk veel groter geworden dan verwacht...
OH GAWD WHAT HAVE I DONE cry cry cry cry cry cry
Dat is altijd zo. Als je hackery begint dan eindig je uiteindelijk ook met hackery code. Daarom moet je gewoon vanaf het begin proberen te zoeken naar de juiste dingen cry
0
Stef

Lid

Berichten
10.150
Reputatie
2
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
Eerdere citaten tonen
Stef schreef:
Heel vieze javascript geschreven omdat het toch maar een klein bestandje zou worden. Is uiteindelijk veel groter geworden dan verwacht...
OH GAWD WHAT HAVE I DONE cry cry cry cry cry cry
Dat is altijd zo. Als je hackery begint dan eindig je uiteindelijk ook met hackery code. Daarom moet je gewoon vanaf het begin proberen te zoeken naar de juiste dingen cry
Ja emo
Spoiler tonen
var followers = [];
var accountA = $(.accountA).html();
var accountB = $(.accountB).html();
var tmstamps = [];
var names = [];
var accountAColor = $(.accountAColor).html();
var accountBColor = $(.accountBColor).html();
var colors = [];

colors.push(accountAColor);
colors.push(accountBColor);

function hexToRgbA(hex){
    var c;
    if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
        c= hex.substring(1).split();
        if(c.length== 3){
            c= [c[0], c[0], c[1], c[1], c[2], c[2]];
        }
        c= 0x+c.join();
        return rgba(+[(c>>16)&255, (c>>8)&255, c&255].join(,)+,5);
    }
    throw new Error(Bad Hex);
}

function isInArray(value, array) {
    return array.indexOf(value) > -1;
}

function calculateGrowth(array) {
    var first = array[0];
    var newArray = [];
    array.forEach(function(entry) {
        newArray.push(entry - first);
    });
    return newArray;
}

$.post("/data/versusfollowersdata.php", {
        accountA: accountA,
        accountB: accountB
    },
    function(data, status){
        var results = JSON.parse(data);
        var allDataA = [];

        var lengths = [];
        var accounts = [];

        // if(results[0][AccountID] != accountA) {
        //     console.log(Eerste AccountID uit resultaten is NIET gelijk aan AccountA ID);
        //     colors.reverse();
        // }

        results.forEach(function(entry) {

            //sorting accounts
            if(!(entry[AccountID] in accounts)) {
                accounts[entry[AccountID]] = [];
            }
            accounts[entry[AccountID]].push(entry[DataA]);
            allDataA.push(entry[DataA]);

            lengths.push(accounts[entry[AccountID]].length);

            //sorting names
            if(!(entry[AccountID] in names)) {
                names[entry[AccountID]] = entry[InternalName];
            }

            if(!(entry[AccountID] in colors)) {
                colors[entry[AccountID]] = entry[ColorA];
            }

            if(!isInArray(entry[Timestamp], tmstamps)) {
                tmstamps.push(entry[Timestamp]);
            }
        });

        while(tmstamps.length < Math.max.apply(null, lengths)) {
            tmstamps.push(NaN);
        }
        tmstamps.reverse();

        accounts.forEach(function(entry) {
            while(entry.length < tmstamps.length) {
                entry.push(NaN);
            }
            entry.reverse();
        });

        background = $(#pagecolor).html();
        drawGraph(tmstamps, accounts, "followers", true, names, false);
    });

$.post("../data/versusinteractiondata.php", {
        accountA: accountA,
        accountB: accountB
    },
    function(data, status){
        var results = JSON.parse(data);
        var Ahistory = [];
        var Bhistory = [];
        var tmstamps = [];
        var accounts = [];
        // var reverseColors = false;
        var accountAName = $(.accountAName).html();
        var accountBName = $(.accountBName).html();
        var accountA = $(.accountA).html();
        var accountB = $(.accountB).html();
        var names = [];

        if(results[0][AccountID] == accountA) {
            console.log(Eerste AccountID uit resultaten is NIET gelijk aan AccountA ID);
            colors.reverse();
        } else {
            accountAName = $(.accountBName).html();
            accountBName = $(.accountAName).html();
        }

        // if(results[0][AccountID] != accountA) {
        //     console.log(Eerste AccountID uit resultaten is NIET gelijk aan AccountA ID);
        //     colors.reverse();
        // }

        results.forEach(function(entry) {
            if(entry[Type] == "M") {
                if (!(entry[AccountID] in accounts)) {
                    accounts[entry[AccountID]] = [];
                }
                if (entry[AccountID] == accountA) {
                    Ahistory.push(entry[Number]);
                    names[entry[AccountID]] = accountAName;
                } else {
                    Bhistory.push(entry[Number]);
                    names[entry[AccountID]] = accountBName;
                }

                if(!isInArray(entry[Datestamp], tmstamps)) {
                    tmstamps.push(entry[Datestamp]);
                }
            }
        });

        while(Ahistory.length < tmstamps.length) {
            Ahistory.push(NaN);
        }

        while(Bhistory.length < tmstamps.length) {
            Bhistory.push(NaN);
        }

        tmstamps.reverse();
        Ahistory.reverse();
        Bhistory.reverse();

        var mentions = [];
        mentions.push(Ahistory);
        mentions.push(Bhistory);
        mentions.reverse();


        // background = $(#pagecolor).html();
        // var graphcolor = hexToRgbA(# + background);
        drawGraph(tmstamps, mentions, "mentionhistory", false, names, false);
    });

//Om cijfers achter de komma te voorkomen, bepalen we de stepsize door minimale en maximale data te verwerken tot de stepsize:
function stepSize(min, max) {
    if((max - min) < 10) {
        return 1;
    } else {
        return 0;
    }
}

function drawGraph(labels, datasets, canvasid, growth, names) {
    var data = [];
    var count = 0;
    var currentName = [];
    var current = 0;
    // console.log(names);
    names.forEach(function(entry) {
        currentName.push(entry);
    });

    for(k in datasets) {

        if(datasets.hasOwnProperty(k)) {
            var color;
            var allColors = [];
            colors.forEach(function(entry) {
                allColors.push(entry);
            });
            if (colors[current] == null) {
                color = rgba(0, 171, 169, 0.5);
            } else {
                color = hexToRgbA(# + colors[current]);
            }

            var numericArray = [];

            datasets[k].forEach(function(entry) {
                if(isNaN(entry)) {
                    numericArray.push(0);
                } else {
                    numericArray.push(entry);
                }
            });

            var usableData = datasets[k];
            if(growth == true) {
                usableData = calculateGrowth(numericArray);
            } else {
                usableData = datasets[k];
            }

            // var maxGrowth = Math.max.apply(calculateGrowth(numericArray));
            var hidden = false;
            // console.log(currentName[current]);

            var obj = {
                label: currentName[current],
                data: usableData,
                fill: false,
                lineTension: 0,
                backgroundColor: color,
                borderColor: color,
                hidden: hidden
            };
            data.push(obj);
            count++;
            current++;
        }
    }

    // [{
    //     label: canvasid,
    //     data: data1,
    //     fill: false,
    //     lineTension: 0
    // },
    // {
    //     label: canvasid,
    //     data: data2,
    //     fill: false,
    //     lineTension: 0
    // }];
    var config = {
        type: line,
        data: {
            labels: labels,
            datasets: data
        },
        options: {
            responsive: true,
            legend: {
                position: bottom
                // onClick: function() {}
            },
            hover: {
                mode: label
            },
            scales: {
                xAxes: [{
                    display: true,
                    scaleLabel: {
                        display: true,
                        labelString: Time
                    }
                }],
                yAxes: [{
                    display: true,
                    scaleLabel: {
                        display: true,
                        labelString: canvasid
                    },
                    ticks: {
                        fixedStepSize: 0
                    }
                }]
            },
            title: {
                display: true,
                text: Graph of  + canvasid
            }
        }
    };
    $.each(config.data.datasets, function(i, dataset) {
        var background = color;
        // console.log(dataset);
        // dataset.borderColor = background;
        // dataset.backgroundColor = background;
        // dataset.pointBorderColor = background;
        // dataset.pointBackgroundColor = background;
        dataset.pointBorderWidth = 1;
    });
    var ctx = document.getElementById(canvasid).getContext("2d");
    window.myLine = new Chart(ctx, config);

    // $("#" + canvasid).click(function(e) {
    //     var activePoints = myLine.getElementsAtEvent(e);
    //     console.log(activePoints);
    // });
}
crycrycry
toevoeging op maandag 14 november 2016, 151038:
Nu moet ik de kleuren zien te reversen wanneer accountA of accountB niet overeen komen met de JSON resultaten cryFML
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Tijd om te refactoren @Stef!
0
Stef

Lid

Berichten
10.150
Reputatie
2
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
Tijd om te refactoren @Stef!
Het enigste wat ik nu zou kunnen veranderen is het omgaan met parameters. Dat met de kleuren hangt met plakband aan elkaar.
Het is vooral een rotzooitje omdat het ene ajax request een compleet andere output geeft dan de andere sadley
0
Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ben ik de enige die last heeft van een 552 Disk full error op server 1? Kan niks meer uploaden terwijl ik maar 26mb in gebruik heb.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Stef schreef:
Eerdere citaten tonen
Rik schreef:
Eerdere citaten tonen
Stef schreef:
Heel vieze javascript geschreven omdat het toch maar een klein bestandje zou worden. Is uiteindelijk veel groter geworden dan verwacht...
OH GAWD WHAT HAVE I DONE cry cry cry cry cry cry
Dat is altijd zo. Als je hackery begint dan eindig je uiteindelijk ook met hackery code. Daarom moet je gewoon vanaf het begin proberen te zoeken naar de juiste dingen cry
Ja emo
Spoiler tonen
var followers = [];
var accountA = $(.accountA).html();
var accountB = $(.accountB).html();
var tmstamps = [];
var names = [];
var accountAColor = $(.accountAColor).html();
var accountBColor = $(.accountBColor).html();
var colors = [];

colors.push(accountAColor);
colors.push(accountBColor);

function hexToRgbA(hex){
    var c;
    if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
        c= hex.substring(1).split();
        if(c.length== 3){
            c= [c[0], c[0], c[1], c[1], c[2], c[2]];
        }
        c= 0x+c.join();
        return rgba(+[(c>>16)&255, (c>>8)&255, c&255].join(,)+,5);
    }
    throw new Error(Bad Hex);
}

function isInArray(value, array) {
    return array.indexOf(value) > -1;
}

function calculateGrowth(array) {
    var first = array[0];
    var newArray = [];
    array.forEach(function(entry) {
        newArray.push(entry - first);
    });
    return newArray;
}

$.post("/data/versusfollowersdata.php", {
        accountA: accountA,
        accountB: accountB
    },
    function(data, status){
        var results = JSON.parse(data);
        var allDataA = [];

        var lengths = [];
        var accounts = [];

        // if(results[0][AccountID] != accountA) {
        //     console.log(Eerste AccountID uit resultaten is NIET gelijk aan AccountA ID);
        //     colors.reverse();
        // }

        results.forEach(function(entry) {

            //sorting accounts
            if(!(entry[AccountID] in accounts)) {
                accounts[entry[AccountID]] = [];
            }
            accounts[entry[AccountID]].push(entry[DataA]);
            allDataA.push(entry[DataA]);

            lengths.push(accounts[entry[AccountID]].length);

            //sorting names
            if(!(entry[AccountID] in names)) {
                names[entry[AccountID]] = entry[InternalName];
            }

            if(!(entry[AccountID] in colors)) {
                colors[entry[AccountID]] = entry[ColorA];
            }

            if(!isInArray(entry[Timestamp], tmstamps)) {
                tmstamps.push(entry[Timestamp]);
            }
        });

        while(tmstamps.length < Math.max.apply(null, lengths)) {
            tmstamps.push(NaN);
        }
        tmstamps.reverse();

        accounts.forEach(function(entry) {
            while(entry.length < tmstamps.length) {
                entry.push(NaN);
            }
            entry.reverse();
        });

        background = $(#pagecolor).html();
        drawGraph(tmstamps, accounts, "followers", true, names, false);
    });

$.post("../data/versusinteractiondata.php", {
        accountA: accountA,
        accountB: accountB
    },
    function(data, status){
        var results = JSON.parse(data);
        var Ahistory = [];
        var Bhistory = [];
        var tmstamps = [];
        var accounts = [];
        // var reverseColors = false;
        var accountAName = $(.accountAName).html();
        var accountBName = $(.accountBName).html();
        var accountA = $(.accountA).html();
        var accountB = $(.accountB).html();
        var names = [];

        if(results[0][AccountID] == accountA) {
            console.log(Eerste AccountID uit resultaten is NIET gelijk aan AccountA ID);
            colors.reverse();
        } else {
            accountAName = $(.accountBName).html();
            accountBName = $(.accountAName).html();
        }

        // if(results[0][AccountID] != accountA) {
        //     console.log(Eerste AccountID uit resultaten is NIET gelijk aan AccountA ID);
        //     colors.reverse();
        // }

        results.forEach(function(entry) {
            if(entry[Type] == "M") {
                if (!(entry[AccountID] in accounts)) {
                    accounts[entry[AccountID]] = [];
                }
                if (entry[AccountID] == accountA) {
                    Ahistory.push(entry[Number]);
                    names[entry[AccountID]] = accountAName;
                } else {
                    Bhistory.push(entry[Number]);
                    names[entry[AccountID]] = accountBName;
                }

                if(!isInArray(entry[Datestamp], tmstamps)) {
                    tmstamps.push(entry[Datestamp]);
                }
            }
        });

        while(Ahistory.length < tmstamps.length) {
            Ahistory.push(NaN);
        }

        while(Bhistory.length < tmstamps.length) {
            Bhistory.push(NaN);
        }

        tmstamps.reverse();
        Ahistory.reverse();
        Bhistory.reverse();

        var mentions = [];
        mentions.push(Ahistory);
        mentions.push(Bhistory);
        mentions.reverse();


        // background = $(#pagecolor).html();
        // var graphcolor = hexToRgbA(# + background);
        drawGraph(tmstamps, mentions, "mentionhistory", false, names, false);
    });

//Om cijfers achter de komma te voorkomen, bepalen we de stepsize door minimale en maximale data te verwerken tot de stepsize:
function stepSize(min, max) {
    if((max - min) < 10) {
        return 1;
    } else {
        return 0;
    }
}

function drawGraph(labels, datasets, canvasid, growth, names) {
    var data = [];
    var count = 0;
    var currentName = [];
    var current = 0;
    // console.log(names);
    names.forEach(function(entry) {
        currentName.push(entry);
    });

    for(k in datasets) {

        if(datasets.hasOwnProperty(k)) {
            var color;
            var allColors = [];
            colors.forEach(function(entry) {
                allColors.push(entry);
            });
            if (colors[current] == null) {
                color = rgba(0, 171, 169, 0.5);
            } else {
                color = hexToRgbA(# + colors[current]);
            }

            var numericArray = [];

            datasets[k].forEach(function(entry) {
                if(isNaN(entry)) {
                    numericArray.push(0);
                } else {
                    numericArray.push(entry);
                }
            });

            var usableData = datasets[k];
            if(growth == true) {
                usableData = calculateGrowth(numericArray);
            } else {
                usableData = datasets[k];
            }

            // var maxGrowth = Math.max.apply(calculateGrowth(numericArray));
            var hidden = false;
            // console.log(currentName[current]);

            var obj = {
                label: currentName[current],
                data: usableData,
                fill: false,
                lineTension: 0,
                backgroundColor: color,
                borderColor: color,
                hidden: hidden
            };
            data.push(obj);
            count++;
            current++;
        }
    }

    // [{
    //     label: canvasid,
    //     data: data1,
    //     fill: false,
    //     lineTension: 0
    // },
    // {
    //     label: canvasid,
    //     data: data2,
    //     fill: false,
    //     lineTension: 0
    // }];
    var config = {
        type: line,
        data: {
            labels: labels,
            datasets: data
        },
        options: {
            responsive: true,
            legend: {
                position: bottom
                // onClick: function() {}
            },
            hover: {
                mode: label
            },
            scales: {
                xAxes: [{
                    display: true,
                    scaleLabel: {
                        display: true,
                        labelString: Time
                    }
                }],
                yAxes: [{
                    display: true,
                    scaleLabel: {
                        display: true,
                        labelString: canvasid
                    },
                    ticks: {
                        fixedStepSize: 0
                    }
                }]
            },
            title: {
                display: true,
                text: Graph of  + canvasid
            }
        }
    };
    $.each(config.data.datasets, function(i, dataset) {
        var background = color;
        // console.log(dataset);
        // dataset.borderColor = background;
        // dataset.backgroundColor = background;
        // dataset.pointBorderColor = background;
        // dataset.pointBackgroundColor = background;
        dataset.pointBorderWidth = 1;
    });
    var ctx = document.getElementById(canvasid).getContext("2d");
    window.myLine = new Chart(ctx, config);

    // $("#" + canvasid).click(function(e) {
    //     var activePoints = myLine.getElementsAtEvent(e);
    //     console.log(activePoints);
    // });
}
crycrycry
toevoeging op maandag 14 november 2016, 151038:
Nu moet ik de kleuren zien te reversen wanneer accountA of accountB niet overeen komen met de JSON resultaten cryFML
Je kan ook gewoon

Array.prototype.hasItem = function(item) { return this.indexOf(item) >= 0 };
/*
var stef = [a, b, c]
undefined
stef.hasItem(a)
true
stef.hasItem(d)
false
*/


toevoeging op maandag 14 november 2016, 16:34:10:
ipv isInArray
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jorzwa schreef:
Ben ik de enige die last heeft van een 552 Disk full error op server 1? Kan niks meer uploaden terwijl ik maar 26mb in gebruik heb.
Je kan het beste een ticket aanmaken, maar ik zal @Lennard even taggen zodat ie nu een notificatie krijgt.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren