« first day (964 days earlier)      last day (3987 days later) » 

7:01 PM
@FlorianMargaine also iirc the xp one was shitty and only allowed you to do the stupid grouped crap no?
been so long
 
@rlemon don't remember
 
Guys, i just found this yankov.us/canvasundo
 
@Anish what is the purpose of this all? is it a game?
 
That's a very cool. Love the undo feature!
 
If you have an alert (like so: codeshare.io/0IIrx), what would be the best/most efficient way to just print it to a div instead of an alert popping up every time?
 
7:04 PM
overwrite window.alert.
 
@Anish all that library is doing is on each change to the canvas it stores a temp version of said revision so you can go back to it
that is way more overhead than any of the other proposed solutions
IMO that is a poor solution.
@Loktar chime in?
 
any better approach? it would be helpful
 
I already mentioned two
Loktar agrees
Altnik on your main site agrees as well
a) re-draw it all each pass
b) store a single background temp canvas, and then the car object, draw both to your main canvas.
 
^
 
option A is probably all you need
^
lol
 
7:07 PM
Just use a, easier
you're just starting out
 
now I point at remove
 
@rlemon lol
 
@DavidPardy window.alert = console.log.bind(console);
console.log it
 
@rlemon I'm confused
 
yeah im seeing you just wrote that in,
 
7:08 PM
didn't know if you got that there or not
codeshare.io is pretty cool
 
but i dont want to print anything to the console, just to the browser window iself
 
never used it before
 
yeah its sweet
 
There needs to be implementations of basic algo's in js :-(
 
1 message moved to Trash can
 
7:09 PM
knapsack and etc :D js makes them so more understandable :P
 
@rlemon rlemon.. Thanks for the reply.. i'm new to HTML5, any sample code base which i can refer?
 
hey I just found out something cool
 
user1596138
What?
 
with a large canvas chrome will show a ruler
I can only get it to show when I drag the scroll
 
7:11 PM
I just learned how to tie a knot, But a special one, not the annoying one that breaks your fingers when you try to untie it
 
er wait, when I readjust the console rather
 
@Anish again, depends on what you are trying to do
make a fiddle or something of what you have
@DavidPardy If you see that code then you can answer me this: do you want a fake kinda alert popup ? or do you have a div in mind?
 
@rlemon reading now,
 
tl;dr are you looking for something like this - rlemon.github.io/Notifier.js - to replace the blocking alerts?
 
hi
 
7:13 PM
ill simplify: the alert aspect does not really matter. its just that when u change the map (ie, pan) the alert pops up every time (map.getCenter).
So, basically i just want map.getCenter to pop up in a div outside the map
 
@Loktar this is in canary since quite some time
 
i appreciate your help, by the way @rlemon
 
codepen.io/loktar00/pen/xyLHD thats so disgusting but so awesome @Loktar
 
haha thanks @Darkyen
 
@Darkyen I linked that earlier, why u no here
 
7:14 PM
I linked it way earlier, like May 1st or something :P
 
haha
@Gacnt i study ... i am trying to make sense out of this shit coursework
thanks to those MIT videos now i understood what dynamic programming is after wasting 4 hours on it
 
so @rlemon my question really is: forget the alert, how do i get (map.getCenter().toString()); stored in 'something' so i can print it to the browser window
 
the first line in the video he said : "Its not programming its a way we used for ages, store in tables"
 
jsfiddle.net/9vwQU @DavidPardy were you lookiing to do something like this?
 
@Loktar btw
 
7:16 PM
..
 
can u add metaballs to the trail generator ?
it'd be great :D :D if u can
 
@Darkyen why can't you?
I can comment the code you modify
 
@Darkyen nothing happening
 
@Gacnt you need webcam
 
yes, that is more or less it
i need to put all that notifier code in my file though?
 
7:17 PM
@rlemon studies my friend :-(
but i am curious to see its results
 
		balls.push(makeBall({
			x: Math.random() * width,
			y: Math.random() * height,
			vx: Math.random() * 4 - 2,
			vy: Math.random() * 4 - 2,
			color: {
				r: Math.random() * 128 + 100|0,
				g: Math.random() * 128 + 100|0,
				b: Math.random() * 128 + 100|0
			},
			size: Math.random() * 20 + 45 | 0
		}));
this is the code to make the balls, set the velocities and all
 
heh... balls
 
0
Q: Build status reporting on javascript project

explunitI have a javascript project which uses Grunt and several plug-ins such as: jshint qunit requirejs optimizer Not all of the developers run the grunt tasks locally (e.g. jshint, qunit), so they might not know if code they committed has issues. It's easy enough to set up a grunt watch task, but ...

 
@DavidPardy or include it above.
it's a project of mine ;)
 
hah, i see that ;)
 
7:19 PM
pretty small footprint
single file.
 
sooooo... how do you guys feel about releasing JSPs (or whatever frontend tech you use) with embedded server-side code? (In this case, Java)
 
@rlemon It's only built-in in Windows 7 and newer
 
PHP folks need not apply.
 
is this a error in jQuery, well its not working
.something > div:first-child
 
I was just asked to replicate a JSP containing database connection logic, from one site, and make it work on another site.
 
7:22 PM
@Connor it looks like a valid selector
 
@JanDvorak hmm, ok thanks
 
@Connor what if the first child isn't a div?
 
damn @rlemon...that is pretty hardcore but it works
 
In the interest of time, I don't have much choice in the matter... but would anyone care to commiserate about writing database connection code into a JSP file directly?
 
@JanDvorak it is
 
7:22 PM
going to lunch now, will come bother you some more /clean it up in a bit :)
 
it's so freaking gross, and doesn't heed separation of logic from presentation at all.
 
@JanDvorak actually its not
@JanDvorak that was the problem, thanks :)
 
user1596138
When are images loaded? If I use onload() from an image with a script right above it it isn't working... Which seems totally backwards to me. DOM is obviously top to bottom and I would think images would be even further behind.
 
.something div:first-of-type should work
@Jhawinsss images are parsed body/window onload and DOM Content Ready
 
@rlemon oh, cool :) thanks
 
7:25 PM
but once parsed they start the download.
each image throws a onload event when the download is complete
same with iframe data
parsed !== downloaded the resource. just means it knows it is there
 
user1596138
@rlemon Which is why there should be no problem with a script above it I thought.
 
nope. have to wait
well, depending on what you are doing
 
Overheard: "I think the only way [the server] is going to generate any traffic is if it goes down."
 
user1596138
@rlemon It's calling a function that measures it's height and an element below it to determine how much space is needed.
 
<img src="pic.png" />
document.images[0].height; // doesn't know until it's downloaded right.
 
user1596138
7:27 PM
So the script is before it that way when it tries to call the function the script has already been parsed. Am I wrong?
 
you need to wait for image.onload = function() { process(image); addToPage(image); postProcess(image); };
show me what you are trying to do
 
user1596138
Alright..... Hold on.
 
user1596138
This is a shitty mockup before I clean it up, so no hate ;)
 
no worries
 
user1596138
I'm gonna make a pastebin
 
7:29 PM
i'm going to look at my VS window now.
:P
ping me when you got it
 
user1596138
function height(idd) {

heightx  =  jQuery('.SPic' + idd).height();
heightxx =  jQuery('#box' + idd).height();
}


<img class="SPic SPic1" onload="height(1);" src="**" width="205px" height="auto"/>
 
user1596138
Actually I slimmed things down for an example...
 
user1596138
@rlemon above is more-or-less what I'm doing. In that order also. Script first, then image.
 
just sayin'...perhaps you might not want to call your variables 'spic'
 
user1596138
@TomW No racism intended. S = Story. So StoryPic1 is the point.
 
7:33 PM
@Jhawinsss you're doing it wrong.
 
user1596138
@Shmiddty Doing what wrong?
 
developing
 
user1596138
You can either elaborate or piss off.... I'd prefer the first ;)
 
The fact that you have code like this: jQuery('#box' + idd)
shows that you're doing it wrong
 
user1596138
5 mins ago, by Jhawinsss
This is a shitty mockup before I clean it up, so no hate ;)
 
7:34 PM
s-pic
lol
i didn't even notice spic
 
user1596138
@rlemon Lol will definitely do that. Me neither.
 
nono SPic is fine
you got title case in there
 
@Jhawinsss so you're going to completely re-write everything?
 
user1596138
@Shmiddty I'm just trying to get the damn script to load now. This isn't final at all.
 
user1596138
@Shmiddty Oh God that's a whole 3 lines of code.... That'll take me soo long.
 
user1596138
7:35 PM
@Shmiddty you don't have to be so negative all the time man.
 
user1596138
Elitists! lmao
 
@Jhawinsss incorrect. You've got code somewhere that is generating elements with sequential ids
this is bad and you should feel bad
 
user1596138
@Shmiddty Incorrect. I have a few elements I wrote up that have sequential IDs. I will change them whenever I want. I'm doing this 1 step at a time, haven't got to element generation yet on it.
 
@Jhawinsss he is right. you should avoid sequential ids
they really serve no purpose.
nodeLists are indexed.
 
@Jhawinsss Sorry for trying to help, don't mind me
 
user1596138
7:38 PM
@rlemon Oh I know. I won't be using them anyway... I'll have classes instead of IDs.
 
ok, well also keep in mind, in the S in JS stands for Sarcasm.
 
simple algorithm to check if a string is composed of the same letter?
 
user1596138
@Shmiddty You can't just assume you already know what I'm doing though... It isn't helpful. You assumed I had some kind of script generating sequential elements when in fact this will have Static elements that are hand-coded.
 
@FlorianMargaine /^(.)\1*$/
 
7:39 PM
@Jhawinsss also, you don't need pooQuery jsfiddle.net/aH9Da
 
!!> "000000".test(/^(.)\1*$/)
 
images will have a height / width property
 
user1596138
@rlemon pooQuery is already being loaded on this page for something else so I may as-well take advantage of it. Otherwise I wouldn't be using it.
 
user1596138
@rlemon Images will have a static width and variable height preserving the aspect ratio of the image.
 
I'm just saying, you don't need jQuery to do this
"already included on the page" doesn't make up for the useless ops
including it where appropriate is important, also using it where appropriate is important.
 
user1596138
7:41 PM
@rlemon Also true...
 
user1596138
I was using pureJS but then I couldn't get the script to work because the functions aren't defined supposedly...
 
user1596138
If I call height(1) from console after the page has loaded it runs fine.
 
/^(.)\1*$/g.test("111")
> true
/^(.)\1*$/g.test("1112")
> false
didn't realize you could \1
@Jhawinsss was this all in the fiddle?
because did you forget to change onLoad?
did you maybe scope block your own function?
 
user1596138
@rlemon Might have! I'll look closer.
 
sooo
same without backreference
 
user1596138
7:45 PM
 
@FlorianMargaine as in, /^(0+|1+|2+|...?
 
or with a for loop or something
 
@Jhawinsss well my example works
 
Why not use a backreference?
 
user1596138
So confused. It's definitely not scope blocked. I'm going to try it without the idd variable.
 
7:46 PM
so unless you are doing something crazy
why are you passing an id and not 'this' keyword
why re-select something you already have a ref to
 
@FlorianMargaine if(_.uniq(str.split('')).length > 1)
 
user1596138
@rlemon I was using this before I ran into this problem and now I was trying to make it specific as possible till I find out what's wrong.
 
@JanDvorak go doesn't support them
 
well i'm telling you, re-selecting an element inside it's own event listener is wrong. don't do that.
 
user1596138
@rlemon I know that, I won't be.
 
7:48 PM
I don't see the point in debugging with it either :P just saying
 
@FlorianMargaine if(a[i]==a[i+1] for all i in (0..a.length-2))
 
user1596138
I don't understand why it isn't working so I've been trying weird shit haha.
 
for-all can be implemented using loops with boolean flags.
 
@JanDvorak can't you just _.uniq(str)?
 
7:50 PM
look at my fiddle - view-source on the results pane and read it
 
user1596138
I haven't decided how to get ahold of the other element that needs measured though.
 
@Shmiddty It might work
 
@Jhawinsss common structure for the html>? just walk over to it
 
user1596138
function height(SPic) {

heightx = SPic.height;
heightxx = jQuery('#box1').height();
SPic.parentnode.maxHeight = heightx + heightxx + 20 + 'px';
}
 
user1596138
This was my original function. #box1 isn't final because I haven't decided how to grab that elements' height yet.
 
7:54 PM
Yeah _.uniq works on strings.
 
user1596138
@rlemon Looks good.
 
user1596138
Ah, the script is in one file which includes the file containing the img with PHP.
 
user1596138
This has something to do with it.
 
@rlemon You're more active than usual today
 
user1596138
7:59 PM
Maybe...
 
Or else I'm just here more today
 
Ugh.
 
@user1447679 Use your words
 

« first day (964 days earlier)      last day (3987 days later) »