« first day (1375 days earlier)      last day (3587 days later) » 

11:00 PM
all would be better than what i'm doing now
:D
 
I'd say my render took about 9 hours
 
GI pls
 
9-10
 
I really need to improve on a few things. 1) how to detect good colour matches.
right now it isn't really panning out the way I want it
 
the imgur urls are randomly generated themselves right?
 
11:01 PM
yes
well idk
maybe
 
if there were some correlation between color pallette and the encoding in the image url
 
var id = '';
for (var i = 0; i < 5; i++) {
    id += parts.charAt(Math.floor(Math.random() * parts.length));
}
return id;
 
isn't there a checksum?
 
that would help
 
var parts = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
 
11:02 PM
I was talking about when someone hosts the image, not you searching for it
 
how I generate mine
 
like when imgur creates the url to post
 
ohh yea idk
 
like how credit card numbers follow a certain algorithm based on mc/amex/visa/etc
 
@Loktar pretty much set on Aug 20
 
11:03 PM
@Mosho ok hopefully all this Hamas business is done by then
was all over the news today that the US has cancelled all Tel Aviv flights
 
i have a big question, its regarding HTML Canvas....
 
!!Should I brace myself or should I leave?
 
@JanDvorak Should I brace myself
 
the winter is coming?
:( I was just getting used to summer
 
a big question is coming
 
11:07 PM
oh, the little icon moved up in the queue
I can't remember why it is little so I'll make it big again
 
@JanDvorak hehe, i am kinda confused whether to ask or not..
 
The little icon is laughing at me for noting that a big question is coming
 
no it is bigger now, when it is little you don't have such problems
just confusion because you think the winter is coming
 
@Loktar yeah, may have to fly with the expensive Israeli airline
these things rarely last that long but who knows
 
yea
 
did Benjamin get called up into reserves?
 
my mom got back from Israel on Saturday, said they heard a few explosions and had to go to a shelter twice
 
@Mosho you can fly out of waterloo
 
He hasn't been around
 
i've seen him around during the day
not on long but been around
 
11:10 PM
@Loktar no idea what battalion he is in as reserves
 
@NokImchen the image isn't loaded
so height/width is 0
and you can't work with an 0 dimension canvas
i've run into this before :/
 
I guess thats it for me, have a nice evening
 
my uncle was drafted twice already
 
you need to wait for the image load event to occur
 
@rlemon oooh!!! wait, let me copy paste a few more code and see whether it works...
@rlemon ya, i need that :)
 
11:11 PM
@rlemon not to Israel :P
 
@NokImchen ew
 
@Mosho sure you can, I just looked up the flights now
 
not direct
 
mostly american airlines but polish and turkish airlines as well
 
hmm
 
11:12 PM
ohh snap air canada has flights
WAY down on the page :P
 
This dont work either :(

var imageObj = new Image();
imageObj.onload = function() {};
imageObj.src = grayscaleX('http://screenshots.en.sftcdn.net/en/scrn/76000/76818/microsoft-small-basic-22.jpg');
 
@Mosho
@NokImchen what is in that function?
 
@NokImchen guess why ;-)
 
@JanDvorak dont knw, i copied form a site and edited it :(
 
don't do that
 
11:14 PM
@rlemon now I'm not sure, $600 is a lot of money but driving to Toronto sucks
*$700
lol, cheaper now than when I checked a month ago
 
    //create canvas
    var canvas = document.createElement('canvas');
    //get its context
    var ctx = canvas.getContext('2d');
    //create empty image
    var imgObj = new Image();
    //start to load image from src url
    imgObj.src = src;

    imgObj.onload = function() {
        //resize canvas up to size image size
        canvas.width = imgObj.width;
        canvas.height = imgObj.height;
        //draw image on canvas
        ctx.drawImage(imgObj, 0, 0);
    };
    // but because the above is async you will have to figure out a way to make the rest of the shit work because just
there, you have a start, now figure out why that change alone isn't going to fix it
@Mosho yea waterloo airport is nice
in and out, no hassle
seriously. like 45 minutes tops.
 
@rlemon i wanted a simple way ... so i did something like stackoverflow.com/questions/2342132/… but in vain :(
 
none of this 3 hours pearson BS
 
@rlemon I bet it is, but I can't find anything at a reasonable rate
 
@NokImchen what I propose is a simple way. but you are blindly copying code which isn't going to work out well
 
11:17 PM
I went to pearson 1 hour prior last couple of times
had no problems
 
shh, waterloo airport is still better :P
 
and I was being sarcastic, those flights you posted are $700 extra :P
 
worth it
 
but wait, those are from pearson :|
 
really?
also those were return flights
I'm assuming you want one way
look at the url.
i didn't expect to see other airports in there
dammit I had the places in the wrong order
just ignore me
 
11:21 PM
you also had the destinations backwards :D
 
> dammit I had the places in the wrong order
 
:ignores rlemon:
 
@Mosho
why are you ignoring me @Mosho
stop ignoring me @Mosho
@Mosho
<3ro
 
@rlemon that's intense
 
I'm sorry
2.9ro
 
11:23 PM
@Mosho what is?
 
@JanDvorak my boner
 
hmmm.... i can get the image width, height, but not getImageData .. :(
 
37.16 minutes to finish mine
404'd: 6891  used: 2084  unused: 3116
 
cray
 
@ZachSaucier ^^
 
11:31 PM
@rlemon xD
so much green
 
this is my most recent work
you can see examples of me getting and waiting for images before I read them
 
but why are you getting so many 404's
 
because I randomly generate imgur id's
 
@rlemon hmmm...... u ppl are computer scientist , while m a layman :(
 
11:38 PM
nahh man. just put things into functions
 
@rlemon i am trying to learn from jsfiddle.net/m1erickson/czmms
 
var img = new Image();
img.crossOrigin = 'anonymous';
img.onload = bar;
img.src = 'someimage.png';

function bar() {
  var height = this.height;
  var width = this.width;
  canvas.height = height;
  canvas.width = width;
  context.drawImage(this, 0, 0);
}
 
@rlemon i am taking rest...before i go mad :|
OMGGGGG!!!... just one line *img.crossOrigin = 'anonymous';* was needed..!!!
Now its working perfect!!!
 
yea but you have the image cached
if I try the page it will still error
you have to wait for the image to load before you paint it
otherwise you getImageData on a 0 dimension element which throws an error
trust me i've done this before
 
i works even if cache is disabled :) :) :)
 
11:49 PM
okay, but i've seen the code
you will run into problems I promise you
 
my new code :P

//create empty image
var imgObj = new Image();
imgObj.crossOrigin = 'anonymous';
//start to load image from src url
imgObj.src = 'https://dl.dropboxusercontent.com/u/139992952/stackoverflow/colorhouse.png';
imgObj.onload = function()
{
//create canvas
var canvas = document.createElement('canvas');
//get its context
var ctx = canvas.getContext('2d');
//resize canvas up to size image size
canvas.width = this.width;
canvas.height = this.height;
//draw image on canvas,
ctx.drawImage(this, 0, 0);
sorry, too big :/
 
okay you wrapped it all in the onload
it is a start :P
and it works
next step is to use functions more and modularize things
but it is good for a start :P +1
 
@rlemon heheh, my start is all i needed, i can do my entire work using that code only :P
 
a few tips. don't use ==, use ===
dont use new Array() use []
=== checks type and checks value, == checks value and tries to form the type accordingly.
it makes for less understood code, and more mistakes in the long run
var arr = new Array();
you could write
var arr = [];
there are a few benefits to this, but other than character length I can't remember them right now
you can google it
 
@rlemon oh, ya, thats a nice trick, but i always forget cos i code a lot in PHP, VB.NET
 
11:54 PM
lol
 
it isn't just a trick. it is what you will encounter more often in js
it is called array literal
there is also object literal
var obj = {};
 
> the Array object can be overwritten in JavaScript, but the array literal can't.
 
lol is that really an argument for it ?
 
^ good reason to use [] vs new Array
 
seems like it is digging deep
 
11:55 PM
[] is prettier imo
 
but some people are silly and will overwrite Array it seems
@Loktar new Object() just seems wrong :P
 
yeah seems really old school
 
*for instantiating a regular object
 
Does anyone know how to download an attachment from a url using AJAX and JavaScript? I am able to access the URL with the appropriate credentials, now I just need to generate the xml report..
 
@Loktar you will be happy(?) to know I can't even go back to 16mg of nic. tried. so my progress went from 50+ to 18 to 16 to 14
 
11:59 PM
nice man
 
I have some 6mg but it is 70%VG
 
woah
ok so in the older perfs literal is way faster
 

« first day (1375 days earlier)      last day (3587 days later) »