« first day (499 days earlier)      last day (4674 days later) » 

17:00
i finally fixxed XSS [hopefully]
@rlemon of course you'd have to hope that the one you're talking to isn't the one who wants to learn english ;)
@Joel I decided to email him + Google Translate.
He can read my broken Cantonese and deal.
@rlemon though that was out of the question ;)
anyways... lunch time.
@rlemon, @Incognito before i forget: since you are both based in ontario, drop me a line if you have any job tips for a random software engineer; [email protected] (or just ignore this).
@Incognito turns out my current salary is higher than $55k
17:02
@Abhishek I implemented a profanity filter with regex once. Decided it wasn't worth a damn.
@Joel but what is your current cost of living :P
user1385191
profanity filters are so fucking dumb
@Incognito it should be around $72k, and i feel very underpaid some days =/
@rlemon oh, that depends. i usually work a few months, then travel (or code for fun) a few
@Joel a month ?
user1385191
17:04
the concept of a profanity filter is stupid
@Abhishek nope, over a year
user1385191
...because it's needless censorship meant to shelter kids
oh ... jeez u gave me an heartattack there lmao
@Abhishek nono! it's around $6k per month
0
Q: Javascript Isometric draw optimization

user13897Im having trouble with isometric tiles drawing. At the moment i got an array with the tiles i want to draw. And it all works fine until i increase the size of the array. Since i draw ALL tiles on the map it really affects the game performance (obviously) :D. My problem is I'm no genius when it...

17:06
@Joel . , i make like 2.5 k a mo free lancing :( ... i feel poor now :(
@Abhishek i'm basing my calculations on ~$37.5 per hour, 160 hours per month
@Abhishek swedish salary?
omg!! lol
i feel like an ass (XD)
@Joel india :-) so that money gets 50x (XD)
@Abhishek i could say "move to sweden, get rich!" but then you'd also get the swedish costs of living ;)
17:08
;)
@Abhishek and that is my current problem, since i'm moving to canada not knowing what to expect in terms of salary or living costs
(but i'm researching it as we type)
anyways i gotta go :( , work time :D :D [ though i love working my ass off but blah with college i feel somtimes like a total ass ] ... good luck btw .. :D
@Abhishek ty, u2
@Incognito thanks for your link that day on XSS :-) , i fixxed the XSS issue pretty paranoidly on my site :-)
@Joel told you, 75k ;)
user1385191
17:18
people complaining about 50-60k being low
user1385191
snickers
@MattMcDonald depends where you live
UK, bath I want £30k. SF, USA I want $90k
@Raynos if you're working, what do you actually get?
@Joel what do you mean?
In the past I've worked for £18k as a placement in bath, UK
@Raynos i mean, "i want 90k" or "i get 90k"?
17:25
I'm paranoid about discussing salary in public logs
@Raynos true, the downside is that it'll be harder to go higher if someone reads a low number ;)
regret saying that. paranoia is back
posted on February 27, 2012

Welcome back to the Badass JavaScript roundup series.  Been busy recently, so sorry about the lack of posts.  Let’s jump right in! PhoneGap has become an Apache incubator project called Cordova, with a nice website and everything.  Be sure to check that out if you’re into developing mobile web apps. Tower.js is an interesting take on frameworks for Node.js, and in fact looks almost exactly lik

@MattMcDonald or shield people like me (I have a simple profanity filter installed) from over-exposure to profanity, since I don't want to use those words myself and seeing them over and over could habituate me to them.
@ThomasShields Y U NO bleep LIKE bleep SWEARING
17:32
swearing is one of the things that kind of keeps me alive and going (especially when there's some fucking IE bug pushing me to the edge)
@Raynos christianity.stackexchange.com/a/1734/194 (same logic applies to more obscene language)
maybe it's just me, but "sheeeesh!!" always seems to do it for me, lol
user1385191
1 message moved to bin
user1385191
2 messages moved to bin
2 messages moved to bin
NO U
No
Because all I would do is shout abuse and belittling at you
its counter productive
lemme know if you ever change your mind. :)
17:41
Hi guys... I'm working on a jsp project.. I want to display a form depending on the parameter
or condition.. if you have a sample. it would really help me alot thanks
user1385191
JAVA**SCRIPT**
hmm yup?
@Peewee JSP = Java Server Pages. Java !== Javascript.
hmm okies.. sorry
room owners: please consider changing the description to begin with "JAVA !== JAVASCRIPT"
17:50
Do any of you guys use prototyping tools? If so, can you suggest one you really like?
@LittleTreeX yeah, it's called my text editor
@LittleTreeX: you mean stuff like DOM-Shim
?
@MattMcDonald you remind me of a real programmer
oh @Raynos, what about the development of DOM-Shim? Is there any way I could help? :)
@Raynos Hmm. how would you visually mock up an entire program will a text editor other than actually writing the program? maybe i asked the wrong (or vague) question
What i mean is something like MS visio
to actually make a mock up of a proposed layout / interface.
17:52
>> If you can't do it in Fortran, do it in assembly language. If you can't do it in assembly language, it isn't worth doing.
hahaha
user1385191
UNIX is my IDE.
@LittleTreeX: I use Balsamiq mockups
it's enough
@FlorianMargaine that's the type of thing I am looking for. Thanks. Have you used others and liked this more?
@LittleTreeX I use my head. Probably why my stuff often sucks, tho.
I haven't used others, but this one is just fine
@ThomasShields: mockups are a great way to share ideas with clients.
17:54
@FlorianMargaine sure, fork it and make it production ready :D
@ThomasShields great, so plug a projector into it and show it to the customer....
/sigh
@LittleTreeX so far, my only customer has been me, so it's working great.
@LittleTreeX there are some visual mockup tools somewhere, I think the word your looking for is wireframes
@Raynos: I'd like to, but i don't know where to start :p which is why I'm asking you where it is...
user1385191
@Raynos did you telepathically realize that I'm posting a set of classList utils today?
17:55
@FlorianMargaine in the code :D
@ThomasShields sounds lucrative.
hello
I also use a sketchpad, or just go ahead and mock up a design in actual markup.
Hey guys. Sorry if my question offtopic a bit.. I'm php dev. Wanna start to learn second language. But really a bit confused, which is popular and worst to waste time? Java/C++/C#? maybe someone can help me..
@FlorianMargaine seriously though, the easiest way to progress is use it in production and fix bugs as and when needed, implement new shims as and when needed
@FlorianMargaine alternatively write more tests, make tests fail, fix code to make tests pass
17:56
@Raynos yes. I should have said "wireframing" or "mockups" instead of prototyping. I can see the confusion.
@FlorianMargaine actually a big feature that's missing is an XHR2 shim, that would be cool
XHR2 meaning cross-browser, eh?
can anyone help me?
something like reimplementing $.ajax() from jQuery?
@David Just ask the question, if someone can, they will.
17:58
@MattMcDonald is it by any chance a DOMTokenList?
@FlorianMargaine but with a decent API, like the XHR2 api
the XHR2 from MDN is decent enough?
oh, alright :)
thanks
user1385191
you know I don't mess with that crap
@FlorianMargaine caniuse is trustful
18:01
s/trustful/trustworthy/
thanks @RyanKinal, my english sometimes sucks :p
@Raynos: which browsers are "modern" enough for you? :) I guess you don't want support for IE6/7... what about opera 11.6 ?
I support the big 5
and IE8
the dom shim wants to support all browsers but IE6/7 are a pain to write shims for
user1385191
one day, people will realize that supporting browser "versions" is stupid
18:03
@FlorianMargaine @Raynos only supports Chrome Canary and the latest experimental dev builds. :P
IE6/7 support is more about "can it actually be done" rather then "i dont like ie6/7"
so you also want full support for ff 3.6 ?
user1385191
but that will come after people realize that UA sniffing "mobile" devices is really dumb too
@MattMcDonald one day you will tell the kids to get of your lawn"
user1385191
I'd have to get a lawn first
18:04
btw, you're saying you're having massive refactor in progress, what is it you're doing?
@FlorianMargaine Nothing really, look in dev
user1385191
no
@FlorianMargaine all the code I have might be on windows, in *unix atm
I'm on a mac, unix-like shouldn't be a problem
@anonymouslyanonymous: never use * in SQL.
user1385191
1 min ago, by Matt McDonald
no
18:07
I use windows to test IE
well, I have a VM :)
1 message moved to PHP
@Raynos already posted it there
1 message moved to PHP
@anonymouslyanonymous now you posted it twice :D
@Raynos: care to explain your development flow? Why is there some node.js app?
well, I'll write the tests first.
oh lol, there is already the XMLHttpRequest.js file... almost empty.
18:22
@FlorianMargaine the node app builds the thing
the other node app is supposed to be an echo server for XHR tests
@FlorianMargaine theres some stuff on the wiki
ok, let me look at it :)
using coffee-script? I thought you were against it :)
coffee-script, underscore, detective, uglify-js... You've lots of dependencies not listed in node_modules :p
user1385191
lol, coffeescript
also, for which node version is that? I'm getting an error on fs.watch "has no method watch"? @Raynos
I'm using node 0.4.11
@FlorianMargaine ...
@FlorianMargaine 0.6 of course
Not my dependencies
oh, I see :)
It was surprising :p
18:44
pd.extend(SomeClass, {
  /* methods */
});

SomeClass({ /* props */ })

function SomeClass(options) {
    return pd.bindAll(pd.extend({}, SomeClass, options));
}
I think I found the holy grail
18:59
@LittleTreeX I'm using this site as a reference: astro.unl.edu/naap/hr/animations/hrExplorer.html
Try to figure out this code:
if ( flag ) true.execute; else false.destroy;
I love reading old articles.
(it's valid JavaScript :P)
19:01
2005 wheee. :D
I managed to make the "x" to move the x-axis and y-axis see my code: jsfiddle.net/tmDpZ/24
execute and destroy trigger functions btw
@David I only meant that you should ask your question (in general), here in the chat room, or better yet post on stackoverflow.com and then link here. I didn't mean that I could help you, since I am rather new at javascript.
but however I'm in doubt how to add options "checkbox"
19:16
@ŠimeVidas extend(Boolean.prototype, { get execute() { trolls(); } })
19:27
@Raynos That's it. I've just come up with some crazy patterns:
if ( valid ) 103..print; else 505..throw;
Here print and throw are functions which have access to the number on which they were invoked on. (So, if valid, then print message 103, else throw error 505.)
Clearly WTFJS material :)
More like OMFGWTFJS.
19:41
why you gotta break the internet?
@rlemon I always hated those () (to invoke functions) anyway :P
never touched LISP then eh?
@rlemon Nope. Did I miss out?
had to do some Erlang back in college... that was weird enough...
20:21
ok @OctavianDamiean making a 10.04 server startup disc as we speak
oops wrong room
and back to work
user1385191
20:37
why do both JSLint & JSHint whine about "\u0020"?
Tradition?
Isn't that what JSLint was made for?
Ugh. Every time I come back to the room, I get sick having that freaking banana on screen.
user1385191
1 message moved to bin
user1385191
hm, seems unicode escaping = an octal
user1385191
I'm really not great with more advanced features
20:53
yeah the banana was a little too loud.
user1385191
thoughts?
21:12
@rlemon my condolences
@MattMcDonald looks fantastic. your code is very easy to read, too.
put it on GitHub.
@Raynos what happened to raynos.org, btw?
FFFFFFFFFFFFFFFFFFFFFFFFF
APACHE >:(
21:27
...ah.
Apache is very reliable, but quite susceptible to misconfiguration resulting in a reliably broken Apache.
user1385191
I'm going to reboot in a bit and run that snippet through the IE gauntlet
@Nathan not like that
Whenever my box reboots, apache boots in the init settings
Mac or what?
If it's loonix, you should be able to find the errant stuff in /etc/rc.d, the hackiest part (imho) of modern computing.
The Mac boot configuration is more confusing to me.
rc.d ?
not init.d ?
21:42
who here is good at maths with javascript =/
user1385191
s/ with javascript/\?/
@Raynos which loonix? one of the big differences amongst flavors is their init script setup.
well my maths i believe is the cause of my script not working but it has stumped me and some one else
@Dave ooh, math. let's see it.
21:44
ubuntu
if u click and drag the image - a few times ull notice it resets
I use RHEL mostly here at work and it manages a set of symlinks (to /etc/init.d) in /etc/rc.d ...
i dunno why but i think my maths is restarting back on 0 for some stupid reason
out for a while...
@Dave hm, weird. looks
21:45
yes it is strange as they are global variables
it resets on mouse move event
from what i can see
@ThomasShields fixed blog
@Raynos awesome.
gah i hate headaches
@Dave why do you divide the height by 4?
21:53
because the image sizes are 64by64
so why is width only divided by 2
@Raynos You have a lot of:
 if (err) {
                return callback(err);
            }
because the graphic in the tile only covers that amount of space
Any way you can curry that?
the rest is alpha
21:56
@Dave okay.
altho the offsets are slightly seperate to that
@Incognito there is no clean way to abstract that
The only thing I can think of is error.passTo("callback", function (err, data) { ... })
But that hurts readability and performance and saves very little
There's probably a way to do it.
@Incognito error.passTo curries it but as mentioned, hurts readability, hurts performance
the issue i face is when scrolling the map it resets itself each time
21:59
I dont use error.passTo for the same reason I dont use pd.beget(Klass, ...) and favour Object.create(Klass).constructor(...)
@Raynos Nothing else really jumped out at me, remind me later in the week and I'll have time to actually look, I'm headed out the door right now
Cheers all!
sure its more verbose but its readable
user1385191
you can come up with a better name than Klass
@Dave I'm missing something incredibly obvious. How does the canvas get redrawn on mouse movement?
function loadall() .. has a set interval at 100ms that calls gameupdate()
gameupdate() clears the cavnas and calls draw() function
user1385191
22:02
@Raynos I see some variables that should be at the top of their containing functions
@MattMcDonald I disagree with that style
I put variables at the top of blocks
It doesn't actually matter to be honest
user1385191
function next(err) {
            if (err) return options.callback(err)
            --counter === 0 && options.callback()
}
user1385191
that scares me
user1385191
I think you're getting too tricky with your code
@Dave offset_x and offset_y represent the offset from the current position, right?
22:08
yeh
so when you click and move the second time - they start on 0 again
so why do you add them to the default position?
you need to store the end position and add them to that
because default position + offset = real position
how do i do the end position
got an example code?
this line: var y = (i+j)*(img[drawTile].height/4) + offset_y; just adds the offset to the position of the object when it starts. That's why it keeps resetting. You need to add the offset to the last calculated position.
how do i do that?
one second.
22:12
function next(err) {
    if (err) {
        return options.callback(err)
    }
    if (--counter === 0) {
        options.callback();
    }
}
@MattMcDonald your right, the above is more sensible
user1385191
I'd add a line for counter -= 1;
user1385191
then if (counter === 0) {
why 3 = ? and not 2
user1385191
I'm starting to prefer this style:
user1385191
var expression = function () {
	if (true) {

	}
};

function declaration()
{
	while (false) {

	}
}
user1385191
22:16
it makes a clear distinction between the two
@Dave === is always better, never use ==
for what reason ? i come from a PHP background so == is what im used to
@MattMcDonald I find --counter === 0 more elegant, I don't care too much for it
@Dave == does type coercion
type coercion is evil
=== doesn't coerce types
oh lol
thanks for the tip
user1385191
PHP does === as well
22:19
counter == 0 && typeof counter == typeof 0 is very roughly the same as counter === 0
"3" == 3 but "3" !== 3
p_0
@ThomasShields any luck with the code?
@Dave sort of. the general idea is that you should have some global x & y vars that determine the position of the stuff. When the offset_y changes, add it to the global y, and instead of doing var y = (i+j)*(img[drawTile].height/4) + offset_y; do var y = (i+j)*(img[drawTile].height/4) + global_y
offset_x and offset_y are global vars
thats why i thought it would work
@Dave yes, but you're wiping them clean everytime you move the mouse.
22:26
yeh - but how is that happening
offset_x = difx;
offset_y = dify;
if i did offset_x = offset_x + difx
then that too also causes an issue
it creates an acceleration in numbers
so you barely move the mouse and the image zooms off the page
right, one second.
ok
@Dave well, shucks. on further thought, that's not the problem at all.
22:31
:P
i remain baffled.
so far everyone has been
i seem to remember a similar bug of sorts from something
hm
@Dave found it.
sort of.
22:34
:O ?
do tell
change difx = (e.pageX - mousex) to difx = (e.pageX)
(and obviously the same with dify)
done - refresh
now, notice you've still got a sort of problem.
still does it :P altho now its moving it in a crazy way
What you were trying to do before is reconcile the position with respect to the browser to the position relative to the canvas
but you were doing it wrong, hence the reset everytime you clicked
22:36
are u sure because the event listener was set to cavnas ?
canvas.addEventListener
means relative to canvas
doesn't matter.
e.pageX is the the mouse position relative to the page.
hmm but it still does it =/
if u try to keep dragging it to the left
it keeps resetting some where miles off screen
one second...we need to figure out how to get the mouse position relative to the canvas, directly.
8
A: Getting mouse location in canvas

Jani HartikainenEasiest way is probably to add a onmousemove event listener to the canvas element, and then you can get the coordinates relative to the canvas from the event itself. This is trivial to accomplish if you only need to support specific browsers, but there are differences between f.ex. Opera and Fir...

well i thought to know how far to move the offset was simple calculate how the mouse moved from "start" to "current"
weather it was canvas or not would not change the pixels it moved
hold on...trying something
22:40
okay
@Raynos did you find the errant rc/httpd configuration?
@Nathan I did
user1385191
prepare for laughs:
user1385191
CoffeeScript makes me want to vomit in every way
22:48
lol
@MattMcDonald mother of ...
user1385191
I wouldn't be opposed to CoffeeScript being prescribed as some sort of vomitory
3
@Dave fixed. Might want to modify it a little bit to get the behavior just right, but see the fixed code here: jsbin.com/iweqiz/edit#javascript - i've commented on the places i changed.
ok bare with me ill put it on my server to test
hmm it still does it for me =/
what browser?
22:54
chrome
if i move the mouse by 1 pixel the image snaps to the mouse
rather than only move it the amount of pixels the mouse moved
plus on load the map is no longer centered
it works for me. i'm running chrome too.
so it loads in the center on load?
no
but that's easy to fix.
and then when u click and drag it just moves by the pixels amount and not jump really far?
just set a starting position
when i click and drag it follows the mouse exactly.
22:56
but if u click far away from the mouse
does it jump to the mouse
yes.
isn't it supposed to?
yeh its not meant to do that
what's it supposed to do?
when u click and drag
nothing?
22:57
ur scrolling the image
well that's because you put the click handler on the entire canvas
you have to test to see if the click happened over the area with the image
u have to have a click handler cos how else could u make it drag?
of course you do
but you can't just assume the user clicked on the image; the handler will fire no matter where on the canvas you click
if they click in the empty space thats fine
as long as the image moves the amount the mouse moves
...it does
22:59
heres an example
refresh my url i sent ya - then try to scroll to the bottom of the map
u wont be able to

« first day (499 days earlier)      last day (4674 days later) »