« first day (1011 days earlier)      last day (3920 days later) » 

2:00 PM
fucking hell. never write everything in tinker.io and not save / at least copy it before running and crashing shit
 
Can we cheat and define helper functions? But at the end o will be a non-trivial use of these helpers (as in, not just o = p)
 
Sure, if you can do it without defining the functions yourself :P
 
...what about IIFEs?
 
No using the function keyword
 
is there any way to save this tab?
can I kill js somehow without killing the page?
 
2:02 PM
No, learn your lesson and write code in an editor
 
:(
 
dang @rlemon are you on the chat 24/7
 
no I sleep
but i'm probably logged in then as well
 
lol, did you finally get your stream running?
 
yes
 
2:05 PM
nice
 
ghad
I have to re-write all of that
:(
I need a smoke
 
@KendallFrey ...and using the function constructor? new Function(...) ?
 
@acidburn69 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
use the fat arrow
 
2:10 PM
Hey! It's not fat... it's just big-boned.
 
don't worry, we're not talking about you.
 
And the skinny arrow obviously has an eating disorder.
 
user1125394
prob...... sqlfiddle.com/#!2/e860a/19 I'm not finding out how to update 2 temp vars, probably and sadly not feasable I think
 
considering that sqlfiddle.com doesn't work... we're not going to be able to help you.
 
12
A: :hover is not working properly in IE9

Peter:hover is only intended for anchors <a> in IE. You must use onmouseover event (pure javascript) or .hover() event (jQuery) instead and change class on hover. Yes, we all love IE.

i think this needs some downvotes... the question is not about ie6
 
user1125394
2:17 PM
a mysql pair (@foo, @bar) would do the trick..
 
@ThiefMaster done
 
user1125394
if only it was possible
 
function midpoint(arr) {
	function m(p1, p2, max, jitter) {
		var mid = Math.round((p1 + p2) / 2);
		if (p2 - p1 <= 1 || p1 === mid || p2 === mid) {
			return;
		}
		var d = ((arr[p1] + arr[p2]) / 2) + (max * (Math.random() * (jitter * 2) - jitter));
		arr[mid] = d;
		m(p1, mid, max / 2, jitter);
		m(mid, p2, max / 2, jitter);
	}
	for( var i = 0; i = xlen; i++ ) {
		arr[i] = 1;
	}
	m(0,xlen,settings.max,settings.jitter);
	return arr;
}
midpoint displacement function
comments?
 
@ThiefMaster Wouldn't a proper doctype solve this problem ?
 
@nubinub Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
2:20 PM
@dystroy Maybe. But I think it's more likely that there's some strangeness when hovering over iframes.
 
@RyanKinal Maybe that too, yes. I won't comment then.
 
Yeah... it seems the :hover doesn't "bubble" from the iframe. Probably because it's a separate document, sort of? Example fiddle
 
@ThiefMaster It's not even an answer to the question.. it doesn't even mention IE9
 
I'm absolutely baffled by the fact that it has 15 upvotes.
 
Why? Lots of bad answers have a lot of upvotes in SO.
 
2:30 PM
Well, I guess the suggestion to use JS solves the problem, but the reasoning is completely wrong.
 
user1125394
damn I'll need to do a join for my prob
 
fml
u know just fml lol
 
who wants to help debug some canvas!
don't everyone jump in at once
 
@rlemon I can offer a few minutes
 
well really my issue is i'm fucking up the array some how
look where the commented out code is.
tl;dr - I generate a midpoint displacement heightmapish row then clone it and run the midpoint on it again
I expected some noise for an output, but you get solid lines.
using points.slice(-1) it somewhere flattens the array into a string
 
2:37 PM
you're getting nice vertical stripes. Do you want something 2Dish?
 
well I expected a noisier outcome
at the moment if you look at the points[] you will see every row is a dupe of the first
for( var y = 0; y <= ylen; y++ ) {
	//points[y] = midpoint(points.slice(-1));
	points[y] = midpoint(points[points.length-1]);
}
 
those stripes do look quite perliny
 
I'm stupid again
 
but midpoint modifies the row
function midpoint(arr) {
	function m(p1, p2, max, jitter) {
		var mid = Math.round((p1 + p2) / 2);
		if (p2 - p1 <= 1 || p1 === mid || p2 === mid) {
			return;
		}
		var d = ((arr[p1] + arr[p2]) / 2) + (max * (Math.random() * (jitter * 2) - jitter));
		arr[mid] = d;
		m(p1, mid, max / 2, jitter);
		m(mid, p2, max / 2, jitter);
	}
	m(0,xlen,settings.max,settings.jitter);
	return arr;
}
 
is there a nice way to replace a certain get-parameter in a string using js?
 
2:39 PM
@rlemon perhaps you are forgetting to actually clone the row?
 
or will I have to use a regex?
 
@rlemon slice[-1] only takes the last element, but doesn't clone it
 
@JanDvorak using .slice(-1) instead of the points.length garbage somewhere converts it to a string?
 
user1125394
 
like flattens the array into a string... so strange
 
2:41 PM
@rlemon arrays in javascript are by-ref. Where are you creating new arrays for the rows?
 
the starred messages are placed perfectly right now btw
 
Ok... so do that? Where is the question? — Neal 48 secs ago
 
@GNi33 lol
 
@rlemon all elements of the 2d array point to the same 1d array.
 
OH FFS
@JanDvorak no my issue was I assumed it returned the value outside of an array
 
2:42 PM
:-)
 
it returns a new array with the value in it
god damn robbie!
 
user1125394
this @bushdiver message should be pinned forever in the rock
 
you are never cloning the rows
 
4 mins ago, by rlemon
for( var y = 0; y <= ylen; y++ ) {
	//points[y] = midpoint(points.slice(-1));
	points[y] = midpoint(points[points.length-1]);
}
returns a new array with the last element, without modifying the original array
 
@rlemon this clones the reference to the last row
 
2:44 PM
I had it commented out because I wasn't using it properlly
 
points[points.length-1].slice(0)
 
user1125394
btw @rlemon just curious are you using canvas professionnaly also?
 
> For strings and numbers (not String and Number objects), slice copies strings and numbers into the new array. Changes to the string or number in one array does not affect the other array.
 
He isn't using JavaScript professionally
 
well that is a lie
 
2:45 PM
It is?
 
i'm starting to do some canvas / d3.js stuff with Wt and Webkit
 
@rlemon a 2d array is an array of references
 
I thought you believed in using different languages at work and for your hobbies
 
@Amaan it just makes sense to do the UI in html5
 
getting to use canvas professionally is fun
 
2:46 PM
@rlemon the references in the original array are spared from change, but the arrays they point to are not.
 
I know @Amaan gets to make games,as do I (training games for the gov)
 
@simonsarris uses canvas professionally as well
 
for( var y = 0; y <= ylen; y++ ) {
	points[y] = midpoint(points.slice(-1)[0]);
}
@JanDvorak that is what I assumed would work
@Loktar chime in tinker.io/ec4e2/1
 
@rlemon you need to clone the row
 
2:47 PM
@rlemon Im past that demo dude
 
it's got nice vertical lines, I was expecting a nosier output
@JanDvorak so show me how to clone it!
 
already worked out my kinks :P
 
lol
I would have done it if I knew how obvy
 
@rlemon points[points.length-1].slice(0)
 
user1125394
there may be not many domains where pure html is used (professionnally) like that
 
2:47 PM
@cx what do you mean?
 
@rlemon or points.slice(-1)[0].slice(0)
 
@JanDvorak won't that slice off ... ohhh, ok. I see now
slice(0) so .. yea.
tinker.io/ec4e2/2 There we go
NOISE
 
@rlemon slice(0) performs a shallow copy of an array
 
if i had a too much recursion issue based on just pasting in the DomConentLoader at the top for mozilla/opera browser, what in the world could make that error since I'm not duplicating anything?
 
user1125394
@Loktar there are not many web technologies based on that, it's maybe to dependant on standards and browsers, and can change in 2 years
 
2:49 PM
@Keith most likely some function is calling itself
 
yeah thats what I thought, but do you think its from that code or something else within the document and it is only starting from that point
the only reason for that top code is for browser compatibility
 
@Keith are you looking for the top of some chain, not realising it is its own parent?
@Keith code pls
 
the code is too long lol
like 3000 characters
 
2:53 PM
@Keith I think you forgot your newlines at home
 
sup nerds
 
TidyUp -> much better :-)
 
sorry I miss the obvious some times, what do you mean?
 
@Keith you are missing all whitespace
 
I get the feeling this is not his code, but something copy/pasted.
 
2:55 PM
ah,right. got to go
 
it is
but it works in my other site just fine
 
do you want us...
 
oww
 
k, bye
 
@Loktar @JanDvorak ended up turning into a nice wood grain effect ;) tinker.io/ec4e2/3
not what I was after.. but still. it is something :/
 
2:58 PM
3k characters is not that long. Call me when you have over 3k lines
 
I just meant in that one line
 
And?
 
you are supposed to have 80 characters per line, not 3000
 

« first day (1011 days earlier)      last day (3920 days later) »